Activity Stream
48,167 MEMBERS
6835 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1.     
    #1
    Member
    Website's:
    putshows.com

    Default 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
    pumpa 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

  2.   Sponsored Links

  3.     
    #2
    Respected 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;
    }
    ?>

  4.     
    #3
    Member
    Website's:
    putshows.com
    thank you

  5.     
    #4
    Respected Member
    You are welcome.

  6.     
    #5
    Member
    Quote Originally Posted by Lock Down View Post
    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;
    }
    ?>
    damn that's legit....i was l00king for this too.. thanks

  7.     
    #6
    Respected Member
    You are welcome.

  8.     
    #7
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    You'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!

  9.     
    #8
    Respected Member
    You wouldn't want to add a prefix to all. Only when one \x for all of them as hex.

  10.     
    #9
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    How 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!

  11.     
    #10
    Respected 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.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Encode Like this..??
    By downloadsmasti in forum Tutorials and Guides
    Replies: 21
    Last Post: 10th Nov 2012, 10:20 PM
  2. Encode to html
    By skinner in forum Web Development Area
    Replies: 4
    Last Post: 21st Feb 2012, 02:28 PM
  3. Need RDP to encode
    By TheLorenalex in forum Hosting Discussion
    Replies: 9
    Last Post: 25th Nov 2011, 06:08 PM
  4. how to encode a movie
    By chaudhary9 in forum General Discussion
    Replies: 2
    Last Post: 24th Sep 2011, 11:27 PM
  5. Need VPS for encode
    By chipve in forum Hosting Discussion
    Replies: 4
    Last Post: 2nd Feb 2011, 03:26 PM

Tags for this Thread

BE SOCIAL