| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Apr 2005 Location: England :D
Posts: 834
![]() ![]() ![]() | convert text to binary hi, Is there any easy way in php to convert letters in to binary? I just thought i would ask if there is any function before writing a long str_replace to replace the letters with binary code. thanks, -ed |
| |
| | #2 (permalink) |
| NamePros Member Join Date: Mar 2006
Posts: 62
![]() | Have you checked pack()? http://us2.php.net/pack
__________________ 123finder.com - Browse dictionary domains & 4-9 letter domains |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Apr 2005 Location: England :D
Posts: 834
![]() ![]() ![]() | hi, thanks for repling so fast. i had a look at that page but i cant work out how i could do this. any ideas? im want 2 basicly. have a string and convert the string into binary. <?php $text = "some text here"; //some function to convert the text into binary echo"$text"; ?> and it would output: 01110011 01101111 01101101 01100101 00100000 01110100 01100101 01111000 01110100 00100000 01101000 01100101 01110010 01100101 |
| |
| | #4 (permalink) |
| Senior Member Join Date: Mar 2005
Posts: 4,948
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | See if you can use this.. PHP Code: |
| |
| | THREAD STARTER #6 (permalink) |
| NamePros Regular Join Date: Apr 2005 Location: England :D
Posts: 834
![]() ![]() ![]() | Wow, Thankyou so much secondvision. i am now for ever in in your debt. Thanks mch and 123finder.com to for your help. That was fast, i only started the thread 50 mins ago. Thanks once again, rep added to every who helped. -ed |
| |