How To Get The WordPress Author ID From A Post ID

I was building a gift registry system where users could create and customize their own registry pages. I needed a way to connect the author ID to the post ID and display a different template based on who was viewing the gift registry page. But I needed to do it outside the loop. How to

Find The Nearest Location From An Array of Coordinates In PHP

As I discussed in previous tutorials, we have the visitor’s latitude and longitude, and an array of locations. Now we can combine the two to figure out which location in that array is closest to our starting coordinates. What is the fastest way to find the nearest location out of an array of coordinates? Import the array of coordinates Based on the array of coordinates, create another array

How To Convert A CSV File Into An Array In PHP

I had a CSV (comma separated value) file that listed all the suburbs in Australia, along with their postcode, latitude and longitude. I needed it saved in a file as an array for a project I’m doing, but didn’t want to have to run multiple regex queries, especially if I needed to use it on