Forum Moderators: coopster
I want to pick up values for variables from special tags that I have created. For eg:
$name variable should pick up the data which exists between the following special tag I have created : <name>John</name>
So $name = John.
In short, this variable will look for the opening and closing tags <name></name> and use whatever data exists between them as its data.
I am a novice at php and I might have used confusing words above.
Any inputs would be appreciated.
something like
preg_match_all("\<.\>[.]+\<\/\>",$input,$matches);
will put everything that matches <*>*</*> into an array called $matches (I think! I'm not that good with regular expressions)
or
preg_match_all("\<name\>[.]+\<\/name\>",$input,$matches);
should match <name>anything</name> (again, I think!)
If you do a search on google for Perl Regular Expressions or RegEx Library you'll find lots of sites explaining them.