strings.inc
changeset 0 c270c8b5ddea
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/strings.inc	Thu May 18 23:47:03 2006 +0200
@@ -0,0 +1,24 @@
+<?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);
+
+}
+?>