Re: [PHP] exclude part of text

2005-11-29 Thread David Grant
Please try: preg_match('/^[^\>]*\>(.*)\*.*$/', $line, $matches); 021 wrote: > the log file is from a radio playlist: > > TIME > ARTIST - TITLE *SONG_CATEGORY > > for example > > 17:12:26 > THE CURE - ALT.END *NEW > > the values before > and after * are changing, hope there's a simple > soluti

Re: [PHP] exclude part of text

2005-11-29 Thread 021
the log file is from a radio playlist: TIME > ARTIST - TITLE *SONG_CATEGORY for example 17:12:26 > THE CURE - ALT.END *NEW the values before > and after * are changing, hope there's a simple solution for this thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

Re: [PHP] exclude part of text

2005-11-29 Thread David Grant
Hi, 021 wrote: > $lines = file('sometext.txt'); > for ($i = 0, $j = count($lines); $i <=1; $i++) { > print $lines[$j - $i]; > } > ?> For a start, try this instead: $lines = file('sometext.ext'); $last = end($lines); Secondly, do you have an example of the real log file? Cheers, David Grant

[PHP] exclude part of text

2005-11-29 Thread 021
Hi, need some help with this one i made a page which is reading the last line from a log file. the log is formatted like this: text1 > MAIN TEXT *text2 i need to get only the MAIN TEXT part, i don't need the text1 > and *text2 i'm using this code thanx -- PHP General Mailing List (http:/