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??!!! Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.