Jump to content

[SOLVED] str_replace|preg_match?


phorcon3

Recommended Posts

<?php

$string='He is driving his car';

?>

 

so, what i wanna do is, find the word "is" as a whole, and delete it.. so the output should be: He driving his car

 

what i tried is str_replace and preg_match

 

ex:

 

<?php


echo str_replace('is','',$string);

?>

 

but this would of course output: He driving h car

 

does anyone know how to do this?

Link to comment
https://forums.phpfreaks.com/topic/114435-solved-str_replacepreg_match/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.