I create a parser for one site, I can not extract data from the 2nd tag

preg_match("/<td><div class=\"g ([A-Za-z]+)\" title=\"([А-Яа-я]+)\"><\/div><\/td><td>(<div class=\"g ([A-Za-z]+)\" title=\"([А-Яа-я]+)\"><\/div>|-)<\/td>/i",$info,$type); print_r($type); 

This code does not work, I can not understand why.

1 answer 1


preg_match_all - Performs a global pattern search in the string Description int preg_match_all ( string pattern, string subject, array &matches [, int flags [, int offset]] )

Searches the subject line for all matches with the pattern pattern and places the result in the matches array in the order determined by the combination of flags flags .

After finding the first match, subsequent searches will not be performed from the beginning of the line, but from the end of the last occurrence found .