strings.inc
author viric@vicerveza
Thu, 18 May 2006 23:47:03 +0200
changeset 0 c270c8b5ddea
permissions -rw-r--r--
Initial release. Usable.
<?php
function strtohtml($cadena)
{
	$new= ereg_replace("[<]", "&lt;", $cadena);
	$new= ereg_replace("[>]", "&gt;'", $cadena);
	$new= ereg_replace("[&]", "&amp;'", $cadena);

	return $new;
}

function strtosql($cadena)
{
	return ereg_replace("'", "'", $cadena);
}

function pricetohtml($price)
{
	if ($price < 0)
		return sprintf("<FONT COLOR=\"FF0000\">%.2f</FONT>", $price);
	else
		return sprintf("%.2f", $price);

}
?>