03-05-2011, 10:58 AM
Thanks guys....
Just something I forgot to put in it.
Notice the & in the changed version, parseHTML(&$str)
This is called Passing by Reference, it simply means that the variable passed to the function, will be updated by the function, no need for returning changed content.
Since the function parseHTML only returns memory usage and execution time, changes to $str don't really happen, since we are not getting them back or outputing them in any way.
Just something I forgot to put in it.
PHP Code:
function parseHTML($str)
{
$data = exec_weight();
$str = file_get_contents($str);
$str = htmlentities($str, ENT_QUOTES);
$data = exec_weight($data[0], $data[1]);
return $data;
}
// Should BE
function parseHTML(&$str)
{
$data = exec_weight();
$str = file_get_contents($str);
$str = htmlentities($str, ENT_QUOTES);
$data = exec_weight($data[0], $data[1]);
return $data;
}
Notice the & in the changed version, parseHTML(&$str)
This is called Passing by Reference, it simply means that the variable passed to the function, will be updated by the function, no need for returning changed content.
Since the function parseHTML only returns memory usage and execution time, changes to $str don't really happen, since we are not getting them back or outputing them in any way.