Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 03:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[PHP] Encoding, chr, ord

Discussion on [PHP] Encoding, chr, ord within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
Achat's Avatar
 
elite*gold: 528
Join Date: Jan 2012
Posts: 2,127
Received Thanks: 2,403
[PHP] Encoding, chr, ord

Hi epvp!

Ich habe in PHP einen String,
Code:
GwujwM}{p}Sv
die Unicode/Ascii-reprsentation des Strings ist
Code:
71|119|117|106|119|162|77|125|123|112|125|168|83|402|129|118|402|174
Nun wird der Array des Ascii/Unicode Codes in einen String umgewandelt, was auch funktioniert. Dieser String wird jetzt wieder in seine Uicode/Ascii-reprsentation umgewandelt, jedoch ist diese nicht identisch mit dem Code oben.

Hier mein Code:

Die Ausgabe des Codes
So sollte es eigentlich aussehen:


Was ist da los?

MfG
Achat is offline  
Old 05/19/2013, 17:00   #2

 
boxxiebabee's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,222
Received Thanks: 500
PHP Code:
function to_chr($str) {
    
$ret '';
    foreach(
explode('|'$str) as $val) {
        
$ret .= chr($val);
    }
    return 
$ret;
}

function 
to_ord($str) {
    
$ret '';
    for (
$i=0$l=strlen($str); $i<$l$i++) {
        
$ret .= ord($str[$i]);
        if(
$i != $l 1)
            
$ret .= '|';
    }
    return 
$ret;
}

$str 'GwujwM}{p}Sƒvƒ';

echo 
$str PHP_EOL;

$ord to_ord($str);
echo 
$ord PHP_EOL;

$chr to_chr($ord);
echo 
$chr PHP_EOL;

$ord2 to_ord($chr);
echo 
$ord2 PHP_EOL
Output:
Code:
GwujwM}{p}Sƒvƒ
71|119|117|106|119|194|162|77|125|123|112|125|194|168|83|198|146|194|129|118|198|146|194|174
GwujwM}{p}Sƒvƒ
71|119|117|106|119|194|162|77|125|123|112|125|194|168|83|198|146|194|129|118|198|146|194|174
boxxiebabee is offline  
Thanks
1 User
Old 05/20/2013, 19:36   #3
 
Achat's Avatar
 
elite*gold: 528
Join Date: Jan 2012
Posts: 2,127
Received Thanks: 2,403
Danke fr deine Antwort.

Aber warum hat es bei mir nicht geklappt?

MfG
Achat is offline  
Reply


Similar Threads Similar Threads
JAVA ENCODING HELP!!
10/02/2011 - General Coding - 5 Replies
Sir can you teach me about this?These program is not a fluent one. and i know that there is a more flexible program to this ..it's a factorial thing this should be the output: <<INVALID INPUT SHOULD START FROM 1 to 30>>> Enter a Number:5 5!=5 x 4 x 3 x 2 x 1 = 120 Press "YES" to repeat: YES
[help]text encoding
09/27/2011 - General Coding - 3 Replies
hallo, hat vielleicht jemand ne idee welche crypt form das ist? .M|pF|p.p.F| das ist nur ein part des codes
Need help with packet encoding
09/20/2010 - Kal Online - 11 Replies
Could anyone explain to me how the TCP packets are encoded? I've been looking a bit in wireshark but can't figure it out. I'm trying to send and receive packets without using the actual client. 0000 00 23 69 28 17 4a 00 21 6a bf ed ac 08 00 45 00 0010 00 37 27 1a 40 00 80 06 5e 13 c0 a8 01 65 de 6f 0020 d5 16 fd da 75 31 1f 24 bf 97 6e a2 76 91 50 18 0030 3e e8 bf f9 00 00 0f 00 6c 44 46 c6 f8 2b 68 b3 0040 1f 74 92 ed 2f 0f 00 6c 44 46 c6 f8 2b 68 b3 1f 74 92 ed 2f...
AFX H.264 Encoding
08/10/2009 - Video Art - 4 Replies
Hallo, Also das Encoden ist bei AFX von den Einstellungen her ja ziemlich eingeschrnkt... Gibt es eine Mglichkeit diese Einstellungen zu erweitern? Am besten wr jedoch ein AviSynth Plugin :p, um extern zu encoden. Gibt es sowas? Bedanke mich schonmal im Voraus.
ScriptVessel Encoding
12/29/2006 - Conquer Online 2 - 36 Replies
Anyone know what way the new copartner(script vessel) is encoded/encrypted/packed? If so, that'd be great if you could tell me, so I can get to getting a cracked version up. Thanks, -Andy



All times are GMT +1. The time now is 03:13.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.