Writing php codes from flash

I am currently developing a php encoder from flash. It writes php codes that i made from flash to a new or existing php file. i have a problem on sending codes. I think its because of transfering my codes as a string.

eg:

 
--------------------------------
 flash - input    |  php - output
--------------------------------
<?php             | <?php
echo "test";      | echo \"test"\;
?>                |

The example above happens everytime i try to send a variable containing the code to a php file. It automaticaly adds [ \ ] before and after [ " ]. I have run some tests and concluded that the flash is the one who adds [ \ ] to the variable that i made.

Can anyone help me or give me hints on how can i store varibles with [ " ] not affecting its contents.

thanks in advance.