In my database many posts has some characters like :
[media id=468 width=660 height=440]
With php i want to get media id (the number) and replace it with another function, also after taking the id, dont want that [media id=468 width=660 height=440] to be shown at my posts in html.
Please can some one help with this ?
Thank you a lot
PS : I dont need height and width.
You can use
preg_replace_callback():Will give you
If you change your
do_stuff()callback:This will just give you back the same text if id is not 468 or 222. This is a fairly simple example, I am sure you can figure out how to tweak the behavior to suit your needs.