Kingy Posted January 29, 2008 Share Posted January 29, 2008 In my php irc bot i have made a weather script for it, but the weird thing is, when i output it into the browser it appears as Palmerston North, New Zealand Forecast Temperature: 75 °F (24 °C ) Humidity: 40% Wind: 9 mph (15 km/h) West but using the same thing when i output it in irc it comes out as Palmerston North, New Zealand Forecast Temperature: 75 °F Humidity: 40% Wind: 9 mph as u can see i get the stupid and °F but it also cuts off half of what is being outputted? is this a php fault or irc? Quote Link to comment https://forums.phpfreaks.com/topic/88338-this-is-weird/ Share on other sites More sharing options...
simcoweb Posted January 29, 2008 Share Posted January 29, 2008 Basically your IRC client doesn't know how to interpret those special characters. = space $#176; = degrees You might be better served to just have it say the word instead of using the symbols. °F = degrees Farenheit = try using just a keyboard spacebar Quote Link to comment https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452075 Share on other sites More sharing options...
Kingy Posted January 29, 2008 Author Share Posted January 29, 2008 Well it gets the space and deg sign straight off the weather website, so what would be the best way to go about it? Quote Link to comment https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452130 Share on other sites More sharing options...
laffin Posted January 29, 2008 Share Posted January 29, 2008 thats the thing it gets it off the website like that. if sent to a browser it will look fine, sent anywhere else ya will see the actual page coding without interpretation. use htmlspecialchars_decode function to convert it into a displayable src Quote Link to comment https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452136 Share on other sites More sharing options...
Kingy Posted January 29, 2008 Author Share Posted January 29, 2008 that didnt work but thanks for the suggestion never actually thought about it i have simply made a str_replace which is doing the job but the problem i have now is... its still only showing half the line. echo "Temperature: $tempfar($tempcel)\n"; echo "Humidity: $humid\n"; echo "Wind: $windmph($windkph) $winddir"; as u can see it should echo more than the one variable, but it outputs.. Temperature: 63°F Humidity: 78% Wind: 2mph where it should be Temperature: 63°F(17°C) Humidity: 78% Wind: 2mph(6km/h) NW why is it doing this, if i put everything on seperate lines it works Quote Link to comment https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452150 Share on other sites More sharing options...
Kingy Posted January 29, 2008 Author Share Posted January 29, 2008 I still can't seem to get it all showing on one line?? Quote Link to comment https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452841 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.