Convert String to ByteArray

[CENTER]hi, I’m working on a small web project Combines between flash AS3 and php ,the project Depends on three steps…

1- convert bitMapData to byteArray |with JPGEncoder |
2- convert byteArray to String and Send it to php and data Base.
3- receive again the string byteArray from php and convert it again to byteArray.

the problem is STEP3 >> How to convert String to byteArray??

Thank you to anyone who can help me!!!
[/CENTER]