Hi all!
i am trying to figure how to subtract some string which is between two other strings:
i have:
for(lots of times){
some unuseful text and tags...
<aloha some=text bbbbbbbbb>string</aloha>
some text and other tags that i dont need.
<aloha some=textDiffer ent bbbbbbbb> stringasdf</aloha>
}
so i noticed that the tags are partly similar.
it would then be great to say:
subtract( $content, startTag='bbb>' , endTag='</aloha>')
storing the resulting strings into array $content
if it was a xml document i would parse it, but it is an html with some errors...
i have found this by googleing:
but this doesn't look to be much of PHP...
if you have any suggestion please let me know
thankyou
bili
i am trying to figure how to subtract some string which is between two other strings:
i have:
for(lots of times){
some unuseful text and tags...
<aloha some=text bbbbbbbbb>string</aloha>
some text and other tags that i dont need.
<aloha some=textDiffer ent bbbbbbbb> stringasdf</aloha>
}
so i noticed that the tags are partly similar.
it would then be great to say:
subtract( $content, startTag='bbb>' , endTag='</aloha>')
storing the resulting strings into array $content
if it was a xml document i would parse it, but it is an html with some errors...
i have found this by googleing:
Code:
Answer: How do I extract all text between two keywords like start and end? contributed by Punto ($content) = $string =~ m/ start (.*) end /; That will get the stuff between " start " and " end " into $content.
if you have any suggestion please let me know
thankyou
bili
Comment