|If I understand correctly you want to use a batch script to generate a php script.|
A few points:
These characters need to be escaped (the escape character is the caret "^").
echo <>|&^ -- won't work
echo ^<^>^|^&^^ --will work
If you are using a code block in the batch script market with parentheses (typically used with the for and if commands) then you will also need to escape:
echo )( -- may exit a code block
echo ^)^( -- won't
If you happen to be using delayed expansion (i.e setlocal enabledelayedexpansion) then exclamation marks need to be escaped twice.
echo ! -- if enabled you won't get the exclamation mark
echo ^^! -- escape twice and it will appear
I would also suggest using a dot after echo, instead of a space, so you can output leading spaces and the words "on" and "off"
echo. Leading spaces
echo.on [the word on]