Re: stripping html tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Dotan Cohen <dotancohen@xxxxxxxxx>:
> I took this example from php.net, but can't figure out where I went
> wrong. Why does this:
> $text = preg_replace("/<head(.|\s)*?>(.|\s)*?<\/head>/i" , "" , $text);
>
> throw this error:
> syntax error at line 265, column 39:
> 		$text = preg_replace("/<head(.|\s)*?>(.|\s)*?<\/head>/i" , "" , $text);
> ======================================^
>
> It seems to be pointing to the 'e' is 'head'. Why? Thanks.

Why are you using regexes instead of strip_tags()?

-- 
Matthew Weier O'Phinney           | WEBSITES:
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org
mailto:matthew@xxxxxxxxxx         | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux