I have an array as $arr = array("name" => "Fom Xong" , "Sales" => "100");
From this array I want to generate a string something like this
$str = 'name="Fom Xon" Sales="100"';
Is it possible???
thanks in advance
I have an array as $arr = array("name" => "Fom Xong" , "Sales" => "100");
From this array I want to generate a string something like this
$str = 'name="Fom Xon" Sales="100"';
Is it possible???
thanks in advance
For example you can do like this:
$tmp_arr = array();
foreach ($arr as $key => $val)
$tmp_arr[] = $key.'="'.$val.'"';
$str = implode(' ', $tmp_arr);
sprintf('%s="%s"', $key, $value)... ;)