Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. $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...';
  2.  
  3.  
  4. if(preg_match_all('#{item((?:.*?))}#is', $string, $output, PREG_PATTERN_ORDER))
  5. $matches = $output[0];
  6. foreach($matches as $match){
  7. item_widget(preg_replace("/[^0-9]/", '', $match));
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement