0

Hey guys,

I need some help with preg_replace()

I have something like this....

{$gallery_20}

And I want to use preg_replace to replace it with nothing.... however gallery_20 can be anything... but im not sure on the patten...

Can anyone help please?
I don't understand how to change all this.... $patterns = array ('/(19|20)(\d{2})-(\d{1,2})'); (from php.net)

Dan

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by pritaeas
1
$your_string = preg_replace('/\{\$\w+\}/', '', $your_string);

Edited by pritaeas: n/a

0

Thanks mate!

How do you know what to put? I couldn't find anything on the web about it :(

Dan

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.