Guest_imported
New member
- Jan 1, 1970
- 0
I have a function &getprice() that parsers a HTML document and returns a string (It is a cost of on item). Now I want to make it numeric for adding purposes. What do I do.
Here is how I reference it:
$price=getcost(9662,1,37160,32225);
$tot=$tot+$price
function getcost($id,$totlbs,$from,$to)
{
$page = fopen (" "r"
while (!feof ($page))
{
$line = fgets ($page, 15360);
if (eregi("<TD HEADERS='ROW2 HEADER3' align=right><font face='Arial'><B>", $line, $out))
{
return($line);
}
}
fclose($page);
return(0);
but it will not give me the correct answer. Is this because it is returning a string variable?
Here is how I reference it:
$price=getcost(9662,1,37160,32225);
$tot=$tot+$price
function getcost($id,$totlbs,$from,$to)
{
$page = fopen (" "r"
while (!feof ($page))
{
$line = fgets ($page, 15360);
if (eregi("<TD HEADERS='ROW2 HEADER3' align=right><font face='Arial'><B>", $line, $out))
{
return($line);
}
}
fclose($page);
return(0);
but it will not give me the correct answer. Is this because it is returning a string variable?