Explode doesnt work.

Permalink
Im not sure what im doing incorrectly, but whenever i apply explode( ' ', $tools), it simply returns a single string.

$tools = (string)$cobj->getAttribute('tools_used');


where $cobj is a collection entry pulled from a singleton "page_list".
var_dump($tools) 
  => (un-exploded) string(45) "Dreamweaver Illustrator Photoshop PHP Magento" 
  => (exploded) array(1) { [0]=>  string(45) "Dreamweaver Illustrator Photoshop PHP Magento" }


any ideas what i could have done wrong or not done?

xclydes
 
Tony replied on at Permalink Reply
Tony
could the spaces be the invisible   character instead of a real space?
xclydes replied on at Permalink Reply
xclydes
I'm not 100 sure, but you were right, there was a some special char and not a space. cant believe i spent the past 30-45mins tryin to figure out what i did wrong.

<?php
$tools = $cobj->getAttribute('tools_used');
$tools = explode('%0A',urlencode($tools));
//Results
var_dump($tools) => array(5) { 
[0]=>  string(11) "Dreamweaver" 
[1]=>  string(11) "Illustrator" 
[2]=>  string(9) "Photoshop" 
[3]=>  string(3) "PHP" 
[4]=>  string(7) "Magento" } 
?>


LF line feed %0A

thanx for your suggestion, much appreciated. thats the second time you saved me from banging my head in a wall...lol
thanx.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.