explode a number php
$nums = ""; //Declare a variable with empty set.
$nums .= $number; //concatenate the empty string with the integer $number You can also use
$nums = $nums.$number; // this and the expression above do the same thing choose whichever you
//like.. This concatenation automatically converts integer to string
$nums[0] is now 4, $nums[1] is now 5, etc..
$length = strlen($nums); // This is the length of your integer.
$target = strlen($nums) -1; // target the last digit in the string;
$last_digit = $nums[$target]; // This is the value of 5. Last digit in the (now string)
Also in PHP:
- distance between two locations in php
- file_get_contents() ssl operation failed with code 1
- $var = '<script> php
- create random username and password php
- delete register option laravel 7
- array_key_exists in laravel
- cakephp find_in_set
- create alphanumeric code php
- disable all auth route laravel
- <?php include localhost:8080/index.php?>
- create folder using library in php
- PHP Stream Functions
- error show all php
- add variable days to datsphp
- Laravel Blade Foreach If Empty or Not
- $conn = new mysqli();
- 2 time between add php
- How to use mbstring on Heroku (PHP)
- cache clear in laravel for serve
- How to execute “php artisan migrate” and other Laravel commands in remote server?
- Woocommerce Display Custom Field value on the Email [Custom Field Display 3]
- cache set in laravel
- different time formats in php
- ?name="" value in php