Posted 13 March 2006 - 10:39 PM
I have several sentences in my db (in the 'sentence' field) and I want to display an entire sentence. So far so good. I also have a field "Start" and a field "Finish". In the following sentence...'the quick brown fox jumps over the lazy dog'...I wish to display the part on the sentence that corresponds to the reurned "Start" and "Finish" numbers. So, in the above sentence, the number 5 is returned from the "Start" field and the number 9 is returned from the "Finish" field. What I wish to display is.....'the quick brown fox jumps over the lazy dog' and 'quick'. Is this possible? If it is, could someone point me in the right direction please?
Posted 13 March 2006 - 11:28 PM
Posted 13 March 2006 - 11:35 PM
$start = 5; $end = 9; $str = "the quick brown fox jumps over the lazy dog"; echo $str . "<br />"; echo substr($str, $start, ($end - $start));
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users