Skip to main content

PHP split a string into an array

This is a simple program to split a string into an array elements based on delimiter
.
<?php

$str = "Welcome";
$arr = explode('c',$str);          print_r($arr);

?>

Comments

Popular posts from this blog

PHP program to convert word to digit

<?php function word_digit($word) {     $warr = explode(';',$word);     $result = '';     foreach($warr as $value){         switch(trim($value)){             case 'zero':                 $result .= '0';                 break;             case 'one':                 $result .= '1';                 break;             case 'two':                 $result .= '2'; ...