Issue
This is my associative array .
Array ( [month] => June [sale] => 98765 )
Array ( [month] => May [sale] => 45678 )
Array ( [month] => April [sale] => 213456 )
Array ( [month] => August [sale] => 23456 )
Array ( [month] => July [sale] => 12376 )
I want to convert it into two strings, like this
["June", "May", "April", "August", "july"]
and another one like this
[98765 , 45678 , 213456 , 23456 , 12376 ]
I have used Implode function but I think I am missing something. Can anybody please help ?
Solution
You can simply do this by doing:
$strMonth = implode(', ', $arrVarName['month']);
$strSale = implode(', ', $arrVarName['sale']);
Hope this helps!
Answered By - Khattu Developer Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.