Jump to content

preg_replace() ?


pastet89

Recommended Posts

Hello all! I need some help:

I have this string:

 $string = "a.whatever.could.stay.here.b";

I need by having just "a" and "b" to delete all the string and to have finally:

$final_string = "";

 

On the place of ".whatever.could.stay.here." there could stay really everithing - " ", ",", "." "?", "'", "[", "/", every letter, every number - EVERYTHING. Just the beginning "a" and the end "b" are defined and known. I know that here I can use something like

 

preg_replace  ( mixed $pattern  , mixed $replacement  , mixed $subject)

 

but I don't know how to define the $pattern part of the function and I am not absolutely sure that this function will do something here... Can you help me?  ???

 

Link to comment
https://forums.phpfreaks.com/topic/141323-preg_replace/
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.