Click here to Skip to main content
14,644,614 members
Rate this:
Please Sign up or sign in to vote.
See more:

I want to know how to convert byte array to a string in php code ? Can anyone help me out ?

Thanks in advance !

[Edit: Moved on OP's behalf from non-solution]
echo implode(" ",$arr);
I tried this but it didn't work for me.
Updated 7-Mar-12 4:44am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Have you tried implode yet? I have only used it with arrays of strings sofar, but you can try it out to see if it works for you.

    $arr = ...; // declare a byte array here
    echo implode("",$arr);


HariniPrabhakaran 7-Mar-12 8:26am
I tried this sample example but it didn't work for me !

Manfred Rudolf Bihy 7-Mar-12 10:48am
From the code you posted I can see that you did not initialize the variable $arr to a byte array. Please try again with a byte array. One more thing: Please don't ever say something like "It didn't work for me" without giving us details about what exactly did not work. Always be very specific with your questions and your replies as this will help us in helping you more quickly.

Thank you for your attention! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100