Daniel Schierbeck wrote:
> Chris Boget wrote:
>> Is there a way to replace/remove *whole* words from a
>> phrase? For example:
>>
>> > $exceptionsList = array( 'the', 'other', 'that', 'a' );
>> $stringToParse = 'The other lady that laughed';
>>
>> if( count( $exceptionsList ) > 0 ) {
>>
Chris Boget wrote:
Is there a way to replace/remove *whole* words from a
phrase? For example:
if( count( $exceptionsList ) > 0 ) {
foreach( $exceptionsList as $exceptionPhrase ) {
$stringToParse = str_replace( $exceptionPhrase, '', trim(
$stringToParse ));
}
$retval = trim( $s
2 matches
Mail list logo