<?php $symbol='AMZN'; $url="http://www.amex.com/equities/listCmp/EqLCDetQuote.jsp?Product_Symbol=$symbol"; { exit; } $wzor = '($[0-9 ]+.[0-9]+)'; { ?>
Wyświetla:
Cytat
Ostatni kurs akcji AMZN: $71.84
Dlaczego jak wyświetlam to używam $kurs[1]?
W manualu opis tego parametru wyląda tak:
Cytat
$regs[1] will contain the substring which starts at the first left parenthesis; $regs[2] will contain the substring starting at the second, and so on. $regs[0] will contain a copy of the complete string matched.
Ktoś może mi to wytłumaczyć?EDIT:
na zdrowy rozum powinno chyba chodzić o kolejność wystąpienia dopasowywanego stringu na stronie.
Ale myli mnie trochę to wyrażenie z manuala
Cytat
starts at the first left parenthesis
gdzie parentheisi oznacza nawias. Jaki nawias :|