note 38543 deleted from function.show-source by nlopess
| From: | nlopess@php.net | Date: | Fri, 09 Apr 2004 14:17:10 +0000 |
| Subject: | note 38543 deleted from function.show-source by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67881@lists.php.net to get a copy of this message | ||
Note Submitter: http://iubito.free.fr
----
Hi ! if you want that all PHP functions are transformed into links to php doc... add this code after
an highlight :-)
<?php
$str = preg_replace(
'{([\w_]+)(\s*</font>)(\s*<font\s+color="'
.ini_get('highlight.keyword').'">\s*\()}m',
'<a class="phpfunction" target="_blank" title="doc PHP
$1"'
.' href="http://www.php.net/$1">$1</a>$2$3',
highlight_string($YOUR_STRING, true));
?>
It looks for all colored word followed by a '(' parenthesis.
Enjoy !
Another thing, what do you guys allways use ob_start ????? Don't you see that there is an
optional parameter, when true it returns the string and not write it to the output !
<?php $mystring = show_source('myfile.php', TRUE); ?>
Faster and lighter ! :)