Re: Listing a few words from one sentence ??

From: Date: Thu, 07 Nov 2002 16:03:46 +0000
Subject: Re: Listing a few words from one sentence ??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123269@lists.php.net to get a copy of this message
perl regex to find the ones you want and then print them out... or you could explode then string and put each word in to one array and access the word by the array index... Example: $words = explode( " ", $sentence ); for( $i = 0; $i < 4; $i++ ) { echo "{$words[$i]}"; } On Thu, 2002-11-07 at 22:29, conbud wrote: > Say I have a sentence that contains 8 words, how do I get PHP to list just 4 > of those 8 words ? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- .: B i g D o g :.

« previous php.general (#123269) next »