Return to Snippet

Revision: 3537
at August 9, 2007 14:14 by nicolaspar


Initial Code
function ofuscar( $str ){
    $total = strlen ($str); $salida = "";
    for ($i = 0 ; $i < $total; $i++) {
        $j= ord( substr ($str, $i, 1) ) ;
        $j= $j ^ $i ;
        $salida .= chr($j);
    }
    return $salida;
}
$test = 'hola';
echo $test ."<hr>";
$test = ofuscar( $test ); #Ida
echo $test ."<hr>";
$test = ofuscar( $test ); #Vuelta
echo $test ."<hr>";

Initial URL

                                

Initial Description
$test = 'hola';
echo $test ."";
$test = ofuscar( $test ); #Ida
echo $test ."";
$test = ofuscar( $test ); #Vuelta
echo $test ."";

Initial Title
PHP - Ofuscar Valor

Initial Tags

                                

Initial Language
PHP