In want to read a text based rpt file and show its data column by column. I have a .net code as below which works fine:
if (long.TryParse(str1.Substring(0, 7), out result))
{
str1.Split('|');
string str2 = str1.Substring(194, 16);
}
I tried to write the same code in php as below:
if((int)substr($str1,0,7))
{
$str1=split('\|', $str1);
echo $str2 = substr($str1,194, 16);
}
else
{
echo "<br>";
}
It says:
split(): REG_EMPTY
Please suggest an update in the code that can make the above php code work same like .net code.