lil php help

could anyone write for me a preg_match function or eregi which'll be looking for

<div style="font-size: 23px; font-weight: bold; text-align: center;">17°C</div>

and writing it to some variable? Ofcourse every few hours the temperature will change. Im 2 lazy to learn regular expressions syntax :x
Comments
5
What you actually want?

You wanna get the temperature to string with preg_match/ereg?
Something like this??
Quote
$degree = "17,323232";
$mark = "°C";

$format_first = number_format($degree, 2);
$format = (int)$format_first;

if(ereg["^0-9"],$format) {
echo $format . $mark;
} else {
echo "Unknown degree,you live in panda area?"; // ":D"
}
//will print 17°C,I hope :{D


tbh,I learned regular calculating like half year ago.
As I can remeber.
a-Z alpha to upercase
abcdfsgajsl own numbers/letters
^2 must start with it.
0-9 numbers
..
i thought we could only use regular expressions in javascript:P
Parent
list(,$deg) = explode('<div style="font-size: 23px; font-weight: bold; text-align: center;">', $str, 2);
$deg = (int) $deg;

php is haxx language, so HAXX
wow that stuff always looks soooo fucking hard
Back to top