Not knowing is really gonna bug the crap out of me. So if any of you PHP gurus have a minute...
I've got a string, $output, that has the following in it:
Main Category
Child
Main Category
Child
I need to take that string and poke it repeatedly until it becomes
Child
Child
["Main Category" and "Child" are placeholders for real
(
Read more... )
Comments 2
Technically you could write some code that parses the string and generates tokens (moves it to an intermediary state) then you can print out those tokens in the format you want. However, it's better if you do it at a higher level (ie, what you did: modify the source code that generates the output in the first place) to output the desired result, or at least something more easily parsed.
This is like a vaguely rudimentary version of XSLT
Reply
Reply
Leave a comment