jeff5656 Posted July 6, 2013 Share Posted July 6, 2013 I want to parse the following POSTed variable (notice that each element in this variable is separated by a semicolon and a space) $variable = "201px; 169px; 110px; 114px; 142px; 43px; 112px; " so that $a="201px" $b="169px" etc a) how do i do that b) how do I do that if the number of elements to parse is NOT known? If anyone knows the solution to a) but no tb) thats ok - I can try to figure out b once I underatand how to do a! Link to comment https://forums.phpfreaks.com/topic/279904-parsing-a-posting-variable/ Share on other sites More sharing options...
Psycho Posted July 6, 2013 Share Posted July 6, 2013 explode() I would exlode just on the semi-colon and then use trim() to remove any spaces. Link to comment https://forums.phpfreaks.com/topic/279904-parsing-a-posting-variable/#findComment-1439591 Share on other sites More sharing options...
litebearer Posted July 6, 2013 Share Posted July 6, 2013 hint: explode typing too slow LOL Link to comment https://forums.phpfreaks.com/topic/279904-parsing-a-posting-variable/#findComment-1439592 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.