I have tried to do it myself but I see that it is a bit hard. In my posts there are some short codes like:
[media id=468 width=660 height=440]
I need to get only id of the media and erase all the other words, since now I have used this code:
function do_stuff($values) {
return '<object id="' . $values['id'] . '" />';
}
$text = 'some stuff [media id=468 width=660 height=440] more stuff';
$text = preg_replace_callback('@\\[media id=(?P<id>\\S+) width=\\S+ height=\\S+\\]@',
'do_stuff', $text);
echo $text;
Will give you some stuff <object id="468" /> more stuff
That id is inside a table. After I get the id I need to put it to a function, because I need to get the link that is at the same line with that id.
For example the table has 2 colums, id and link. I need to echo the link.
Thank you