Skip to main content

PHP combine the array elements into a string


<?php 

       $arr = array(9,1,2013);
       $str = implode('/',$arr); 
       echo $str; 

 ?>

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'; ...