ballhogjoni Posted February 12, 2007 Share Posted February 12, 2007 does anyone know why this isn't working? <?php $octstr = '\074\141\040\150\162\145\146\075\042$l1dt\042\076\074\142\076'; $octary =explode('\\',$octstr); $str = ''; for($i=1;$i<count($octary);$i++) { $str .= chr(octdec($octary[$i])); } echo $str; ?> Quote Link to comment https://forums.phpfreaks.com/topic/38106-solved-does-anyone-know-why-this-insnt-working/ Share on other sites More sharing options...
utexas_pjm Posted February 12, 2007 Share Posted February 12, 2007 It looks like it's working to me. It prints the following characters: <a href="><b> This ascii chart might be of some use: http://www.asciitable.com/ Best, Patrick Quote Link to comment https://forums.phpfreaks.com/topic/38106-solved-does-anyone-know-why-this-insnt-working/#findComment-182444 Share on other sites More sharing options...
kenrbnsn Posted February 12, 2007 Share Posted February 12, 2007 Why do you say it isn't working? Also, the code you're using assumes that each entry consists of one octal number. In the sample string you have one entry that also consists of non-digits, "042$l1dt". What is that supposed to be? Ken Quote Link to comment https://forums.phpfreaks.com/topic/38106-solved-does-anyone-know-why-this-insnt-working/#findComment-182465 Share on other sites More sharing options...
ballhogjoni Posted February 12, 2007 Author Share Posted February 12, 2007 I didnt know that ken. thx! Its a variable. and now its wotrking. I didnt do anything. its gotta be magic. Quote Link to comment https://forums.phpfreaks.com/topic/38106-solved-does-anyone-know-why-this-insnt-working/#findComment-182467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.