Results 1 to 10 of 16
-
3rd Mar 2012, 05:37 PM #1OPMemberWebsite's:
putshows.comencode PHP
Hi KWWH friends,
please i want to know to encode for example word "stream" to "\x73\x74r\x65\x61m"
i know how to decode the line by htmlentities and that stuff but i don't know how to encode.
thanks in advancepumpa Reviewed by pumpa on . encode PHP Hi KWWH friends, please i want to know to encode for example word "stream" to "\x73\x74r\x65\x61m" i know how to decode the line by htmlentities and that stuff but i don't know how to encode. thanks in advance Rating: 5
-
3rd Mar 2012, 09:25 PM #2Respected Member
Ok here you go.
PHP Code:<?php
$all = 'RM50';
// single
$r = 'R';
$m = 'M';
$a = '5';
$b = '0';
$s=strtoHex($all);var_dump($s);
// single
$s=strtoHex($r);var_dump($s);
$s=strtoHex($m);var_dump($s);
$s=strtoHex($a);var_dump($s);
$s=strtoHex($b);var_dump($s);
exit();
exit();
function strToHex($string)
{
$hex='';
for ($i=0; $i < strlen($string); $i++)
{
$hex .= dechex(ord($string[$i]));
}
return $hex;
}
?>
-
6th Mar 2012, 09:13 AM #3OPMemberWebsite's:
putshows.comthank you
-
6th Mar 2012, 02:48 PM #4Respected Member
You are welcome.
-
6th Mar 2012, 06:16 PM #5
-
6th Mar 2012, 08:12 PM #6Respected Member
You are welcome.
-
7th Mar 2012, 12:22 AM #7(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comYou'll have to prefix it with \x too (\x[0-9a-f]+ is a hex string in php).
Could probably do it without a loop in php5, like so:
PHP Code:function x($s) {
return preg_replace_callback('#.#', function($m) {
return '\x' . dechex(ord($m[0]));
}, $s);
}
Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
7th Mar 2012, 03:43 PM #8Respected Member
You wouldn't want to add a prefix to all. Only when one \x for all of them as hex.
-
7th Mar 2012, 11:00 PM #9(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comHow do you mean?
\x41\x42\x43 isn't the same as \x414243.
The former will output as 'ABC' (in javascript, PHP doesn't use \x), while the latter will output as 'A4243'. These characters match the expression \x[a-f0-9]{2}, so the numbers following the match won't be taken into account.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
8th Mar 2012, 12:37 AM #10Respected Member
You need to stick with one thing. You are jumping all over . The \X is not used in php and therefore if you wanted to prefix the text by a single \X as an informational comment than one\X would have been sufficient.
He was not talking javascript or anything but a simple php routine.
What you coded won't work on half the servers as set up today. I know it won't on mine.
If you wanted to create a separate topic with a complete routine with the complete classes that would be helpful to those who like to learn and have the up to date software capable of using it.
But adding this to a simple question is like giving instructions for wormhole travel to someone asking about the best transportation available in their city today.
I expect this from some of the other posters here to try and show off their skills but expected more from an experienced coder/anaylst.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
How to Encode Like this..??
By downloadsmasti in forum Tutorials and GuidesReplies: 21Last Post: 10th Nov 2012, 10:20 PM -
Encode to html
By skinner in forum Web Development AreaReplies: 4Last Post: 21st Feb 2012, 02:28 PM -
Need RDP to encode
By TheLorenalex in forum Hosting DiscussionReplies: 9Last Post: 25th Nov 2011, 06:08 PM -
how to encode a movie
By chaudhary9 in forum General DiscussionReplies: 2Last Post: 24th Sep 2011, 11:27 PM -
Need VPS for encode
By chipve in forum Hosting DiscussionReplies: 4Last Post: 2nd Feb 2011, 03:26 PM
themaPoster - post to forums and...
Version 5.23 released. Open older version (or...