Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. foreach ($details as &$row) {
  2.  
  3. $content = &$row['content'];
  4. $images = $row['images'];
  5.  
  6. if (preg_match_all('/\IMAGE\|(\d+)/', $content, $matches)) {
  7. foreach ($matches[1] as $id) {
  8. foreach ($images as $image) {
  9. if ($image['id'] == $id) {
  10. $contentz[] = str_replace('<!--IMAGE|' . $id . '-->', $image['filename'], $row['content']);
  11. }
  12. }
  13. }
  14. }
  15.  
  16. }
  17.  
  18. print_r($contentz);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement