Jump to content

explode ain't exploding as expected


cooldude832

Recommended Posts

Im afraid your conclusion is incorrect.

 

<?php
$str = 'text<moretext';
foreach(explode('<',$str) as $v){
echo $v.'<br />';
}
?>

 

Produces exactly the same as:

 

<?php
$str = 'text < moretext';
foreach(explode('<',$str) as $v){
echo trim($v).'<br />';
}
?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.