<?php
/**
* Class Entitize v1.0
*
* Copyright (C) 2007
* Jonathan Discipulo <hide@address.com>
* http://www.exploitedweb.com/
*
* - Converts string into HTML entities
* - Useful for cloaking texts or email addresses
* - Hides important 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
*
**/
// }}
// {{ Entitize class
class Entitize {
// }}
// {{ constructor
function Entitize() {
return true;
}
// }}
// {{ convert function
function convert( $string ) {
// initialize variables
$entitized = '';
for ($x=0; $x<=strlen($string)-1; $x++) {
$ord = sprintf("%03u", ord(substr($string, $x, 1)));
$entitized = $entitized . chr(38) . chr(35) . $ord . chr(59);
}
return $entitized;
}
}
?>