Answers for "php string to array if no comma"

PHP
0

if any comma in string in php

php function strpos return position of string if it's not false or -1 then your string contain character.

$searchForValue = ',';
$stringValue = '115,251';

if( strpos($stringValue, $searchForValue) !== false ) {
     echo "Found";
}
Posted by: Guest on October-26-2020
0

create array from string with commas php

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

Code answers related to "php string to array if no comma"

Browse Popular Code Answers by Language