function highlight($text)
@param string $text the code to highlight
@return string the code, highlighted
Highlights the code and links functions to their page on php.net
function add_tags($text, $ype = "code", $div = 0)
@param string $text the code to parse
@param string $type the code tag to add
@param bool $div switch beetwen divs and "pure-tags"
@return string the new text, tagged!
Actually executes the query and return the result
function check_be_tags($code)
@param string $code the code
@return bool returns TRUE if tags are present, else FALSE
Checks if the begin and end tags are present in the code block
function add_be_tags($code)
@param string $code the code
@return string the code with tags
Adds the begin and end tags to a code block
The following code will add the "box" tag to the text and highligh it using php's default colors. Then it will link all the functions to their page on the php manual
include_once('highligher.php');
$highlight = new Highlighter;
$code = $highlight->add_tags($code, "box");
$code = $highlight->highlight($code);
echo $code;
If the code passed to the method was
$code = "Hello World!";
add_tags($code, "boxed", 1);
The returned code would be (in HTML)
If the code passed to the method was
$code = "Hello World!";
add_tags($code, "boxed-class", 0);
The returning text would be (in HTML)
No changes made since now.
Copyright (C)2007 Giulio Bai
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
A copy of the full license can be found in the official GNU's site
If you found this program useful, share it! Maybe it can help also other people!
Don't be scared, it's free, editable, redistributable.
So... share, Share, SHARE!
If you want to know more about this program, you can contact me at slide.wow@gmail.com.
Wht do you think about this program? Is it useful? How can be improved?