PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
brownguy02
Forum Newbie
Posts: 3 Joined: Wed Dec 22, 2004 1:02 pm
Location: Trenton, ND
Post
by brownguy02 » Wed Dec 22, 2004 1:19 pm
I am Noel King; 21 years old. 1 year ago I had a stroke
. So.. Typo/Grammer sucks.. sorry
i try regular expressions i cant working.. $fdate -> "Dec 21"...
tomorrow $fdate -> "Dec 22" so..
$fdate =
dynamically
$test =
string
$matches =
match
help ..thank you!
ps. 1 year from now maybe 100% speech/grammer good..
Last edited by
brownguy02 on Wed Dec 22, 2004 1:57 pm, edited 1 time in total.
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Wed Dec 22, 2004 1:29 pm
I'm not too sure what you're after.
Can you provide an example of what you will be passing in and what you want to match against?
i.e Examples of what $fdate and $test might be ?
brownguy02
Forum Newbie
Posts: 3 Joined: Wed Dec 22, 2004 1:02 pm
Location: Trenton, ND
Post
by brownguy02 » Wed Dec 22, 2004 1:37 pm
$fDate = Date(M,d); //dynamically
$Matches -> Array
$test ->
Code: Select all
............<TR>
<TD WIDTH="15%">Tonight|Today|<BR> Dec 21</TD>
<TD WIDTH="10%"><IMG SRC="http://image.weather.com/web/common/wxicons/31/29.gif" WIDTH=31 HEIGHT=31 BORDER=0></TD>
<TD WIDTH="35%">Partly Cloudy</TD>
<TD WIDTH="25%" ALIGN="CENTER"><B>-5&deg;</B></TD>
<TD WIDTH="15%" ALIGN="CENTER">0 %</TD>
</TR>
<TR>
<TD CLASS=f2a><FONT CLASS="blkVerdanaText10">Wed <BR> Dec 22</FONT></TD>
<TD CLASS=f2a><IMG SRC="http://image.weather.com/web/common/wxicons/31/13.gif" WIDTH=31 HEIGHT=31 BORDER=0></TD>
<TD CLASS=f2a><FONT CLASS="blkVerdanaText10">Scattered Flurries</FONT></TD>
<TD CLASS=f2a ALIGN="CENTER"><FONT CLASS="blkVerdanaText10"><B>7&deg;/-12&deg;</B></FONT></TD>
<TD CLASS=f2a ALIGN="CENTER"><FONT CLASS="blkVerdanaText10">20 %</FONT></TD>
</TR>
<TR>
<TD ><FONT CLASS="blkVerdanaText10">Thu <BR> Dec 23</FONT></TD>
<TD ><IMG SRC="http://image.weather.com/web/common/wxicons/31/30.gif" WIDTH=31 HEIGHT=31 BORDER=0></TD>
<TD ><FONT CLASS="blkVerdanaText10">Partly Cloudy</FONT></TD>
<TD ALIGN="CENTER"><FONT CLASS="blkVerdanaText10"><B>4&deg;/-6&deg;</B></FONT></TD>
<TD ALIGN="CENTER"><FONT CLASS="blkVerdanaText10">0 %</FONT></TD>
</TR>
<TR>
<TD CLASS=f2a><FONT CLASS="blkVerdanaText10">Fri <BR> Dec 24</FONT></TD>
<TD CLASS=f2a><IMG SRC="http://image.weather.com/web/common/wxicons/31/14.gif" WIDTH=31 HEIGHT=31 BORDER=0></TD>
<TD CLASS=f2a><FONT CLASS="blkVerdanaText10">Snow Shower</FONT></TD>
<TD CLASS=f2a ALIGN="CENTER"><FONT CLASS="blkVerdanaText10"><B>28&deg;/19&deg;</B></FONT></TD>
<TD CLASS=f2a ALIGN="CENTER"><FONT CLASS="blkVerdanaText10">30 %</FONT></TD>
</TR>.........
brownguy02
Forum Newbie
Posts: 3 Joined: Wed Dec 22, 2004 1:02 pm
Location: Trenton, ND
Post
by brownguy02 » Wed Dec 22, 2004 1:41 pm
brownguy02 wrote:
$fDate = Date(M,d); //dynamically
i use "dec 22" and "Partly Cloudy"
tomorrow
i will use "dec 23" and "i dont know.. snow? sunny?"
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Wed Dec 22, 2004 2:02 pm
That's beyond my limited regex skills but you might want to take a look at
http://pear.php.net/package/Services_Weather instead. It will be easier to use the weather services provided by weather.com rather than parse their html output.