RE: [PHP-WIN] modifying a substring

From: Date: Mon, 26 Apr 2004 19:54:07 +0000
Subject: RE: [PHP-WIN] modifying a substring
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-23547@lists.php.net to get a copy of this message
Or: <? $string = Ur_contents; $text = implode ('<code>', $string); Echo ($text[0]); ?> -----Message d'origine----- De : William CANDILLON [mailto:william.candillon@tiscali.fr] Envoyé : lundi 26 avril 2004 21:16 À : php-windows@lists.php.net Objet : RE: [PHP-WIN] modifying a substring Use xml_parse_into_struct () : <? $string = Ur_contents $ xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser, $string, $ vals, $ index); xml_parser_free($xml_parser); highlight_string($vals['0']['value']); ?> To show the code out the <code></code> : <? $string = Ur_contents $i = 1; $fp = fread($string, $i); While (eregi("<code>", $fp)== false) { ++$i $fp = fread($string, $i); } $txt = substr ($fp, -6); Echo ($txt); ?> -----Message d'origine----- De : John Yu [mailto:johnyu@revolutionhosting.net] Envoyé : lundi 26 avril 2004 18:44 À : php-windows@lists.php.net Objet : [PHP-WIN] modifying a substring Hi guys I want to do some fancy syntax highlighting so I added <code> </code> to my input text. Is there a way to take the entire input text, but only take the substring between those tags, do something to the substring and put it back into the original text? Thanks in advance John -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.windows (#23547) next »