Click to See Complete Forum and Search --> : html to php converter
vickofpak
02-17-2008, 08:36 AM
I ve built this simple online tool to convert html, css or javascript into php compatible coding string. Not much tricky but just another link for portfolio. Suggessions required from seniors plz.
Location: http://www.movetophp.com
sheephat
02-17-2008, 10:11 AM
It does not recognise multiple lines, it writes the lot as one.
Also is echo the only thing it does??
dougal85
02-17-2008, 02:28 PM
Does this code do anymore than what can be achieved with the heredoc syntax? Not to mention the heredoc syntax doesn't require escaping characters everywhere...
http://uk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
I imagine its mostly a learning experience. I'm just curious. Am i not right in thinking it only needs to cancel double quotes?
dougal85
02-17-2008, 02:43 PM
oh, found a bug. It doesn't cancel out dollar signs.
for example, if you do the following;
<html>
<script>
function $(id){
return document.getElementById(id);
}
</script>
</html>
The Simple way to fix this problem would be to be surround the full thing with single quotes rather than double quotes.
Weedpacket
02-17-2008, 04:07 PM
Am i not right in thinking it only needs to cancel double quotes?Heredoc syntax would also require dollar signs to be escaped.
If I was going to echo a big chunk of arbitrary text it would be as
?>
<html>
<script>
function $(id){
return document.getElementById(id);
}
</script>
</html>
<?php
If I needed to capture that to a variable
ob_start();
?>
<html>
<script>
function $(id){
return document.getElementById(id);
}
</script>
</html>
<?php
$variable = ob_get_clean();
Although in both cases I'd need to properly escape "<?php" if it appears.
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.