I want to use these icons in a dynamically generated PHP image so people can embed the weather on their webpage.
Right now I'm using met.no's weather service, which provides a neat property called "symbol" and is an integer. 1 = Sunny, 2 = Cloudy etc. A Pull Request on the weather icons repo includes mapping for met.no which is cool, because I can call echo "<i class='wi wi-yrno-$symbol'></i>";
and get the right icon always.
But I don't know how to do this using PHP's image creation functions. In Javascript, you can do this: Programmatically get FontAwesome unicode value by name , but how would I do this in PHP? I think I need to just make an array of array("wi-yrno-1 => "(unicode escape code here)", "wi-yrno-2" => "(another escape code here) ...
but I wondered if there was a better way.