liza Posted May 20, 2007 Share Posted May 20, 2007 Hello, i am having a small problem with my code i want to convert from array to String . i tried using the (string) casting but it doesnot work? how can i do it??!!! Link to comment https://forums.phpfreaks.com/topic/52212-convert-from-array-to-string/ Share on other sites More sharing options...
PC Nerd Posted May 20, 2007 Share Posted May 20, 2007 um, its either explode or implode, i forget: $string = implode($Arrayname, "concatination string"); eg $array is: "things", "are", "ugly"; then implode($array, " ") would return $string = "things are ugly"; gdlk Link to comment https://forums.phpfreaks.com/topic/52212-convert-from-array-to-string/#findComment-257527 Share on other sites More sharing options...
MadTechie Posted May 20, 2007 Share Posted May 20, 2007 yep implode <?php $theArray = array("hello","to","the","world"); $theString = implode(",", $theArray ); echo $theString; ?> Hello,to,the,world Link to comment https://forums.phpfreaks.com/topic/52212-convert-from-array-to-string/#findComment-257551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.