Dynadot โ€” .com Transfer

Str_replace for the whole word

SpaceshipSpaceship
Watch

baris22

Established Member
Impact
1
I want to find and replace some words. the problem is i do not want to replace the words if they are in a word.

forexample this is the sentence:

PHP:
I want to change.

the output should be:

PHP:
I want change.

as you see "an" did not changed in the word "change"
because "an" is not by it self.

PHP:
$short = array('of', 'to', 'in', 'an');
$title = str_replace($short, "", $title);

How can i do this?

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
PHP:
$title = str_replace(" ".$short." ", " ", $title);

It's not perfect, but that will do it.
 
0
•••
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back