I am trying to grab stock quotes from Yahoo Finance. I am completely new to regular expressions...
The stock price comes like this: <span id="yfs_l84_$symbol">price</span>, where $symbol is the ticker symbol and price is something like 6.75 (no $ sign)
I really have no idea what I'm doing with preg_match, and the PHP documentation didn't really help much. When I run this code, I get "error: Undefined Offset: 1," referring to $match[1].
Question
generalt
I am trying to grab stock quotes from Yahoo Finance. I am completely new to regular expressions...
The stock price comes like this: <span id="yfs_l84_$symbol">price</span>, where $symbol is the ticker symbol and price is something like 6.75 (no $ sign)
This is what I have so far:
I really have no idea what I'm doing with preg_match, and the PHP documentation didn't really help much. When I run this code, I get "error: Undefined Offset: 1," referring to $match[1].
What am I doing wrong?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts