php: convert array variable to string? -
string converting array
<?php $value1 = "hello, world"; $convert = explode(" ",$value1); echo $convert[1]; //hello echo $convert[2]; //world // convert particular number of array string $s = implode(" ", $convert[2]); ?>
i want output : world
error message:
error: warning: implode(): invalid arguments passed in
i tried, not done 1
if want output world
, should work:
<?php $value1 = "hello, world"; $convert = explode(", ",$value1); //echo $convert[0]; //hello echo $convert[1]; //world ?>
Comments
Post a Comment