note 91547 deleted from function.explode by danbrown
| From: | danbrown@php.net | Date: | Tue, 16 Jun 2009 15:47:47 +0000 |
| Subject: | note 91547 deleted from function.explode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156925@lists.php.net to get a copy of this message | ||
Note Submitter: jeff at smackblast dot com
----
Seems like lots of employers are using a low-level question like "How would you isolate the
word 'jumped' from the 'quickbrownfoxjumpedoverthelazydog' using
explode()?"
Easy answer.
$original = "'quickbrownfoxjumpedoverthelazydog";
$exploded = explode('jumped', $original);
$replaced = str_ireplace($exploded, '', $original);
echo $replaced; //jumped