split string on char php code example
Example 1: php foreach string char
//Split int char array
$chars = str_split($str);
//Loop each char
foreach($chars as $char)
{
// your code
}
Example 2: explode in php
$str = 'one two three four';
$numbers4 = explode(' ',$str);
Example 3: string to array php
str_split ( string $string [, int $split_length = 1 ] ) : array
Example 4: how to split sting in php
<?php
list($user, $pass, $uid, $gid, $extra) =
split(":", $passwd_line, 5);
?>