I need help in converting JavaScript to PHP
Posted: Thu Apr 24, 2008 6:09 am
I have a function in java script that I have no idea how to convert it into PHP and what are the equivalent codes for it
can anyone help?
Code: Select all
//to Extract Updated time info string
function GetExchangeData(UrlResult)
{
Result=new String(UrlResult);
Str=Result.substr(Result.indexOf("Last Trade",0)+1);
//Get the Token after Last Trade string in between character ';' and "Bid"
//Ex: Last Trade3:30PM · 46.49000Bid
BeginIndex=Str.indexOf(";",0)+2;
EndIndex=Str.indexOf("Bid",0)-1;
Data=Str.substr(BeginIndex,EndIndex-BeginIndex);
Str="";
return Number(Data);
}