b3ta.com talk
You are not logged in. Login or Signup
Home » Talk » Message 25346

ARGHAGAHAAHAGHAHAHAHH
CAN'T FUCKING GET IT TO FUCKIGN WORK!


//BRING ME THE FILE
fopen("http://www.bbc.co.uk/weather/5day.shtml?id=1431", "r");
$html = file_get_contents("http://www.bbc.co.uk/weather/5day.shtml?id=1431");


// Take out Those nasty forward slashes

$html = strip_tags($html);

$html = str_replace('/', '', $html);

$search = "/BBC - Weather Centre - 5 Day Forecast in Celsius for Bridgend, United Kingdom @import url('includestbenh.css') ; HomeTVRadioTalkWhere I LiveA-Z Index Text only version | Print | Send this to a friend Make this my Homepage | Feedback | Help Weather Home UK World Sports Coast and Sea Climate Change Features Weatherwise About BBC Weather Message Board Site FAQ Painting the Weather About the BBC Bridgend, United Kingdom Current Nearest Observations:sunny 21°CEasterly Wind (19mph)Relative Humidity (%): 54,Pressure (mB): 1027, Falling,Visibility: Very good(View this forecast in Fahrenheit) Symbol key WednesdaySunrise 6:38 (BST)Sunset 19:46 (BST) 23°C 16°C 7 good 1032 47 ThursdaySunrise 6:39 (BST)Sunset 19:44 (BST) 23°C 18°C 8 good 1021 57 FridaySunrise 6:41 (BST)Sunset 19:42 (BST) 20°C 16°C 9 moderate 1011 79 SaturdaySunrise 6:42 (BST)Sunset 19:39 (BST) 19°C 13°C 9 moderate 1008 70 SundaySunrise 6:44 (BST)Sunset 19:37 (BST) 17°C 15°C 13 moderate 1007 55 Nearest weather observation station: Latitude: 51.5871,Longitude: -3.779.Observed: Wed 892004 at 1800 (GMT)Distance from this location to the weather station: 16.8(km) Searchfor a new 5 day forecast Set Bridgend, United Kingdom to be my hometown Printable version Key to symbolsKey to indices Country guide The symbols shown for each day in the five day forecasts represents the predominant weather expected on the day in question. This is calculated based on a weighting of different types of weather, so if a day is forecast to be sunny with the possibility of a brief shower, then we will see a sunny or partly cloudy symbol rather than a rain cloud. The maximum temperature is the highest temperature forecast between 0600 and 1800, whereas the minimum temperature is the lowest temperature expected from 1800 on the day in question to 0600 the following day. BBC Weather Centre in association with the Met OfficeTerms of Use | Privacy & Cookies Policy/";
$replacement = "";
$html = preg_replace($search, $replacement, $html);


echo $html;


it just leaves it without stripping what I tell it to
(, Wed 8 Sep 2004, 21:10, archived)
Throw a pencil sharpener at it
so that the little shavings get in its eyes.
(, Wed 8 Sep 2004, 21:12, archived)

$search is almost certainly wrong...
(, Wed 8 Sep 2004, 21:12, archived)
You need to replace ") with ";)
that works for me
Edit: Don't take notice of this, it is a facetious response..you went silent, so I hope you aren't testing
(, Wed 8 Sep 2004, 21:12, archived)
DAMN YOU!

(, Wed 8 Sep 2004, 21:25, archived)
isn't the / at the end of $Search
escaping the " ?
(, Wed 8 Sep 2004, 21:16, archived)
no,
backslashes escape :)
(, Wed 8 Sep 2004, 21:17, archived)
In Perl, escape is
\, not /
not sure about PHP tho'
(, Wed 8 Sep 2004, 21:17, archived)
ah, sorry.
reading in php, and I always get slashes mixed up anyway
(, Wed 8 Sep 2004, 21:18, archived)
Just practice
calling backslashes "BACKslash" regularly got that fixed for me.
(, Wed 8 Sep 2004, 21:20, archived)
I can just never remember which one i'm supposed to use.
I can only suggest changing $search to something simpler to make sure the code actually works, then building it back up until something clicks
(, Wed 8 Sep 2004, 21:27, archived)
Mind
Pissage
(, Wed 8 Sep 2004, 21:28, archived)
You need to recombobulate
the interflacial desnogificator.
(, Wed 8 Sep 2004, 21:24, archived)
You come to meeee
ah knooow aaall thee best leeenks in town. Like that one.
(, Thu 9 Sep 2004, 2:20, archived)