preg_replace help!
am 03.05.2006 23:24:58 von Nathan Heaps------=_NextPart_000_006E_01C66ED6.804155E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> Hey, I need some help.
> I am trying to parse a forum post using php, but it parses it =
everytime it=20
> sees the letter, not the thing in quotes. Any help?
>=20
> function bbcodereplace($subject){
> // $document should contain an HTML document.
> // This will remove HTML tags, javascript sections
> // and white space. It will also convert some
> // common HTML entities to their text equivalent.
> $search =3D array ("[b]", // Bold
> "[u]", // Underline
> "[i]", // Italics
> "[/b]", // Bold Close
> "[/u]", // Underline Close
> "[/i]"); // Italics Close
> // '@&(gt|#62);@i',
> // '@&(nbsp|#160);@i',
> // '@&(iexcl|#161);@i',
> // '@&(cent|#162);@i',
> // '@&(pound|#163);@i',
> // '@&(copy|#169);@i',
> // '@(\d+);@e'); // evaluate as =
php
>=20
> $replace =3D array ('',
> '',
> '',
> '',
> '',
> '');
> // '>',
> // ' ',
> // chr(161),
> // chr(162),
> // chr(163),
> // chr(169),
> // 'chr(\1)');
>=20
> return preg_replace($search, $replace, $subject);
> }
>=20
> PLEASE NOTE: This is for a phpBB forum, not vBulliten or =
InvisionPowerBoard=20
>
------=_NextPart_000_006E_01C66ED6.804155E0--