note 68361 added to function.dechex
| From: | forosatbasnekdotcom at osu1 dot php dot net | Date: | Mon, 24 Jul 2006 16:13:34 +0000 |
| Subject: | note 68361 added to function.dechex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115099@lists.php.net to get a copy of this message | ||
I leave code blocks them that I have made to be able to replace the content of certain blocks of JS
that used eval () I hope serves to them.
// Convert hex 2 str
// Imput Example: \x68\x6f\x6c\x61\x20\x6d\x75\x6e\x64\x6f
$que=( isset( $_POST['hexadecimal'] ) )?$_POST['hexadecimal']:"";
$valores=explode( "\\\x", $que );
for ( $i=0; $i<count( $valores ) ; $i++) {
echo chr( hexdec( $valores[$i] ) ) ;
}
// Convert str 2 hex
// Imput Example: hola mundo
$que=( isset( $_POST['ascii'] ) )?$_POST['ascii']:"";
for ( $i=0; $i<strlen( $que ) ; $i++) {
echo "\\x".dechex( ord( substr( $que, $i, 1) ) ) ;
}
----
Server IP: 130.206.1.5
Probable Submitter: 83.53.27.214
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.dechex.php
Edit -- http://master.php.net/note/edit/68361
Del: integrated -- http://master.php.net/note/delete/68361/integrated
Del: useless -- http://master.php.net/note/delete/68361/useless
Del: bad code -- http://master.php.net/note/delete/68361/bad+code
Del: spam -- http://master.php.net/note/delete/68361/spam
Del: non-english -- http://master.php.net/note/delete/68361/non-english
Del: in docs -- http://master.php.net/note/delete/68361/in+docs
Del: other reasons-- http://master.php.net/note/delete/68361
Reject -- http://master.php.net/note/reject/68361
Search -- http://master.php.net/manage/user-notes.php