Markpyro
08-18-2006, 8:16 PM
edit (I realize that I spelled the function wrong in the title, I know it's not supposed to be spelled that way)
I have a php file, that when you start it, finds data from a text file, and is supposed to find the last line of text (appears as last line when presented in html, as is divided by <br>'s) and put it into an image.
Here's a snippet that I'm having problems with:
$data=fread($o,filesize($filename));
$find = '>';
$string = $data; // Data is set at this point
$string = strrchr($data,$find); // Poof! Gone!
$string = ShortenText($string);
Okay, here's the definition via PHP.Net of the function, Strrchr:
strrchr -- Find the last occurrence of a character in a string,
This function returns the portion of haystack which starts at the last occurrence of needle and goes until the end of haystack.
Now, when If I echo $data before it's modified, it looks fine. Once I apply the function to it, though, it dissapears. I just want to gather a portion of $data, the last line, and display it in an image. But, for some reason, strrchr doesnt output anything. Wtf?
-MP
I have a php file, that when you start it, finds data from a text file, and is supposed to find the last line of text (appears as last line when presented in html, as is divided by <br>'s) and put it into an image.
Here's a snippet that I'm having problems with:
$data=fread($o,filesize($filename));
$find = '>';
$string = $data; // Data is set at this point
$string = strrchr($data,$find); // Poof! Gone!
$string = ShortenText($string);
Okay, here's the definition via PHP.Net of the function, Strrchr:
strrchr -- Find the last occurrence of a character in a string,
This function returns the portion of haystack which starts at the last occurrence of needle and goes until the end of haystack.
Now, when If I echo $data before it's modified, it looks fine. Once I apply the function to it, though, it dissapears. I just want to gather a portion of $data, the last line, and display it in an image. But, for some reason, strrchr doesnt output anything. Wtf?
-MP