Answers for "convert string into array php"

PHP
8

explode comma php

$myString = "9,[email protected],8";
$myArray = explode(',', $myString);
print_r($myArray);
Posted by: Guest on April-17-2020
0

php string to array

$array = explode(' ', $string);
Posted by: Guest on July-04-2021
0

string to array in php

<?php

$str = "Hello world. It's a beautiful day.";
print_r (explode(" ",$str));

?>
Posted by: Guest on July-02-2021
0

string to array php

explode()
Posted by: Guest on September-07-2020
0

string to array php

str_split ( string $string [, int $split_length = 1 ] ) : array
Posted by: Guest on February-24-2020
2

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)
Posted by: Guest on June-20-2020

Code answers related to "convert string into array php"

Browse Popular Code Answers by Language