Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/88338-this-is-weird/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452075
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/88338-this-is-weird/#findComment-452150
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.