Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $string ='This is my body of text, you should all check out this item {item(7)} or even this item {item(21)} they are great...';
- if(preg_match_all('#{item((?:.*?))}#is', $string, $output, PREG_PATTERN_ORDER))
- $matches = $output[0];
- foreach($matches as $match){
- item_widget(preg_replace("/[^0-9]/", '', $match));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement