Log into the Google Analytics API using PHP and CURL using Username/Password Authentication

Google have finally made an API available for Google Analytics although it’s currently in beta and the specs are subject to change. I’ve been playing around this morning logging in usingClientLogin Username/Password Authentication with PHP and CURL and show how to do this here. In future posts I’ll look at how to actually use the API but this will get us all started for now.

Categories PHP

Get a list of all available functions with PHP

PHP has the function get_defined_functions() which allows you to get a list of all the available system and user defined functions in an array. This post looks at how to use the get_defined_functions() function, the output from it and how to sort the list into alphabetical order. Using get_defined_functions() get_defined_functions() returns an array containing two …

Read more

Categories PHP

Sending a CSV file to the web browser with PHP

In the past I’ve written about how to save data as a CSV file using PHP, MySQL queries and mysqldump and in this post show how to send the results of this data to a web browser setting the headers correctly with PHP so the browser gives you a "save as" dialog instead of displaying it on the page. The headers also include the filename which is supplied as the default in the save as dialog.

Categories PHP

Listing MySQL tables with PHP

This post shows how to use the MySQL "SHOW TABLES FROM" SQL query to get a list of tables using PHP. This list could either be stored to an array or echoed out to web browser, command line etc.