Location: PHPKode > scripts > Entitize Class for PHP 5 > class.entitized.php
<?php

/**
 *	Entitize Class | PHP 5
 *
 *	Copyright (c) 2009
 *	Jonathan Discipulo <hide@address.com>
 *	http://www.exploitedweb.com/
 *
 *	- Converts string into HTML entities
 *	- Hides sensitive data from info diggers/bots
 *	- Makes portions of your webpage unsearchable
 *	- Prevents search engines from indexing entitized data
 *
 *	This library is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU Lesser General Public
 *	License as published by the Free Software Foundation; either
 *	version 2.1 of the License, or (at your option) any later version.
 *
 *	This library 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
 *	Lesser General Public License for more details.
 *
 *	You should have received a copy of the GNU Lesser General Public
 *	License along with this library; if not, write to the Free Software
 *	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 *  http://www.gnu.org/copyleft/lesser.html
 *
**/

// }}
// {{ Entitize Class
class Entitize {

	private $entitized;

	// }}
	// {{ Constructor
	public function __construct() {
		return true;
	}
	
	public function convert( $string ) {

		for ($x=0; $x<=strlen($string)-1; $x++) {
			
			$ord = sprintf("%03u", ord(substr($string, $x, 1)));
			$this->entitized = $this->entitized	. chr(38) . chr(35)	. $ord	. chr(59);
		 
		}
		
		return $this->entitized;
	
	}
	
	// }}
	// {{ Destructor
	public function __destruct() {
		// reserved for codes to run when this object is destructed
	}	

}

?>
Return current item: Entitize Class for PHP 5