I am familiar with strip_tags() where it strips all the HTML and PHP tags
from a file... however, I want to do something almost opposite... I want to
scan an HTML file and retrieve a tag... I want allow a user to have a
template html file that can contain custom HTML tags that I can later read
and do something with... I want to do something more than just perform a
str_replace when the tag is found, as I want to permit my custom tag to have
parameters... thus... if I have the following in an HTML file
<CUSTOM HEIGHT=5 SOMETHINGELSE=4>
What function could I use in PHP that would alow me to retrieve that full
line of text? I gather someone might recommend preg_match or something,
however anything more than basic regular expressions are a bit difficult for
me...
All help appreciated - replies please via the newsgroup, thanks...
randelld
> if I have the following in an HTML file
>
> <CUSTOM HEIGHT=5 SOMETHINGELSE=4>
>
> What function could I use in PHP that would alow me to retrieve that
> full line of text? I gather someone might recommend preg_match or
> something, however anything more than basic regular expressions are a
> bit difficult for me...
I haven't understood everything, but jumping to this point you may use :
$ok=preg_match_all('`<CUSTOM[^>]*>`i',$html_page,$reg);
if $ok is true then $reg is an array of all matching strings.
--
P'tit Marcel
Okay... I think that should do it for me... and I gather I can later replace
the tag with preg_replace, true?
Thanks for the help