Guest User

Untitled

a guest
Jul 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. $string = 'I wish you a merry <span style="font-size: 14px;">Christmas</span> and a happy new <span style="font-size: 18px;">year</span>!'
  2.  
  3. $arr[0] = 'I wish you a merry '
  4. $arr[1] = '<span style="font-size: 14px;">Christmas</span>'
  5. $arr[2] = ' and a happy new '
  6. $arr[3] = '<span style="font-size: 18px;">year</span>'
  7. $arr[4] = '!'
  8.  
  9. $arr = explode('<span style="font-size: ', $string);
  10.  
  11. preg_match_all('~<span style="font-size:' . $fontSize . 'px;">(.*?)</span>~', $string, $output[$fontSize]);
Add Comment
Please, Sign In to add comment