php - split between 2 pattern in html tag -


this question has answer here:

i have html tag this

<img src="ngakak.gif" title="ngakak" /> 

and want split tag 2 pattern, title= , /> . result array this:

array  (      [0] => <img src="ngakak.gif"      [1] => "ngakak"  ) 

i want splitting of 2 patterns worked direct in 1 regex. how preg_split ?

are looking extract title element img tags?

preg_match_all('/< *[img][^>]*title *= *["']{0,1}([^"'>]*)/',$content,$matches); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -