Skip to content

The funniest example I had ever seen

php-dog.gifToday, while I was looking for str_replace() documentation, I found this example:

$phrase = "You should eat fruits, vegetables, and fiber every day.";
$healthy = array("fruits", "vegetables", "fiber");
$yummy = array("pizza", "beer", "ice cream");
// Provides: You should eat pizza, beer, and ice cream every day
$newphrase = str_replace($healthy, $yummy, $phrase);

I was laugthing like 3 minutes.

Post a Comment

Your email is never published nor shared. Required fields are marked *