This is a simple tutorial that teaches you how to create a html to php converter using PHP. This is the function to perform the conversion function htmltophp($input){ if($input != "" && is_string($input)){ $inputarray = explode("\r\n", $input); $output = ""; foreach($inputarray as $line){ $output .= "echo \"".addslashes($line)."\";\n"; } return $output; } else{return $input;} } PHP: To view more of this tutorial please click here: HTML to PHP converter tutorial Cheers