Reputation: 77
I already have the following in place to explode the br's in $tmp..
$tmp = explode('<br>', $tmp);
echo $tmp[0];
echo "<br>";
echo $tmp[1];
Now, in $tmp[0] there is a bunch of text, separated by a pipeline "|". ie: word1|word2|word3|word4|word5 take notice, the last once doesn't end in a pipeline..
How can I explode $tmp[0] to grab each bit of text, turn them into an array, ie: $pipetxt[0], $pipetxt[1], etc. without the pipelines..
Can I do the exact same as the above, after the above occurs.. but go;
$pipetxt = explode('|', $tmp[0]);
echo $pipetxt[0];
echo "<br>";
echo $pipetxt[1];
Thank you!
Upvotes: 0
Views: 592
Reputation: 786
But you should probably adopt some loops.
$tmp = explode('<br>', $tmp);
foreach($tmp as $pipeline){
$pipetxt_array = explode('|', $pipeline);
foreach ($pipetxt_array as $output){
echo $output."<br />";
}
}
Upvotes: 0
Reputation: 3247
Your explode looks good, and you can output all your $pipetxt
with foreach()
:
foreach($pipetxt as $out)
echo $out . "<br>";
Upvotes: 1