Empty array (which's not empty)
Posted
by
Brut4lity
on Stack Overflow
See other posts from Stack Overflow
or by Brut4lity
Published on 2012-12-09T16:58:58Z
Indexed on
2012/12/09
17:03 UTC
Read the original article
Hit count: 95
while($row = mysql_fetch_row($result)){
preg_match('#<span id="lblNumerZgloszenia" style="font-weight:bold;font-style:italic;">([^<]*)<\/span>#',$row[1],$matches);
$query2 = 'UPDATE content_pl SET kategoria_data='.$matches[1].' WHERE id='.$row[0].';';
mysql_query($query2);
}
I'm doing this preg_match
to get the span
contents into $matches
array.
When I do a print_r($matches)
, it shows the right results but when I use $matches[1]
, it browser tells me that there is no such index.
© Stack Overflow or respective owner