Put text from multiple lines onto one line?

First some background - I want to display picture showing hosts around the world that have accessed a specific file on a server. All that is logged about the hosts is IP address - which is fine. From these IP addresses I can get a general idea of their location - again fine - via http://api.hostip.info/ (a geolocator). Basically, this is to provide a quick visual. It doesn't need to be extremely detailed.

Now, the first part I can handle - converting IP address to Latitude/Longitude. This is done via the following script:

I do have PHP installed. Version 5.2.x (can't remember right off hand). I welcome a PHP based solution, however, will that significantly slow down processing if I am calling a PHP script from within a shell script?