strings.inc
author viric@vicerveza
Thu, 18 May 2006 23:47:03 +0200
changeset 0 c270c8b5ddea
permissions -rw-r--r--
Initial release. Usable.
viric@0
     1
<?php
viric@0
     2
function strtohtml($cadena)
viric@0
     3
{
viric@0
     4
	$new= ereg_replace("[<]", "&lt;", $cadena);
viric@0
     5
	$new= ereg_replace("[>]", "&gt;'", $cadena);
viric@0
     6
	$new= ereg_replace("[&]", "&amp;'", $cadena);
viric@0
     7
viric@0
     8
	return $new;
viric@0
     9
}
viric@0
    10
viric@0
    11
function strtosql($cadena)
viric@0
    12
{
viric@0
    13
	return ereg_replace("'", "'", $cadena);
viric@0
    14
}
viric@0
    15
viric@0
    16
function pricetohtml($price)
viric@0
    17
{
viric@0
    18
	if ($price < 0)
viric@0
    19
		return sprintf("<FONT COLOR=\"FF0000\">%.2f</FONT>", $price);
viric@0
    20
	else
viric@0
    21
		return sprintf("%.2f", $price);
viric@0
    22
viric@0
    23
}
viric@0
    24
?>