PDA

View Full Version : Remove a text



binladun
June 23rd, 2003, 11:48
Hi !

I have this text


<?php
$text =<<<EOF
<FORM>
<input type=text name=name value="%name%">
<input type=text name=age value="%age%">
<input type=text name=email value="%email%">
</FORM>
EOF;
?>


I'm looking for the PHP code that can loop thru the $text and remove the any string start with %xxxx%

Thanks for your help again.

hohoho
June 23rd, 2003, 12:45
$text = eregi_replace("\%(.*)\%", "", $text);