PHP
11 posts · All topics
Download Emails from Gmail as a CSV File — PHP
A fun proof of concept that uses OAuth 2.0 and IMAP to download the emails from a Gmail folder as a CSV file in PHP.
Regular Expression to Validate Mobile Numbers Starting with + (Plus) — PHP
A PHP regular expression that validates mobile numbers with or without a leading + sign.
Simple Pagination Script for PHP
A ready-to-use PHP pagination function. Copy it into your project and adapt it as needed.
Set the HTTP Authentication Header from a Client — PHP / cURL
Protect a REST API with HTTP Basic authentication in PHP, and call it with the right header or with cURL.
RSA Public Key Encryption in an Android App with Server-Side Decryption in PHP
Encrypt data in an Android app with an RSA public key (Bouncy Castle) and decrypt it on a PHP server with phpseclib.
Function to Generate the 12 Month Names in an Array — PHP
A small PHP function that returns the names of all 12 months in an array.
Generate XML from a Two-Dimensional Array — PHP
PHP code that generates an XML file from a two-dimensional array with a known structure.
Symfony Doctrine Pagination Script
Paginate Doctrine query results with filters in Symfony 1.x using sfDoctrinePager, a navigation helper and some simple CSS.
Get the Symfony Web Root URL Without the Script Name
Build the URL of Symfony's web root folder, without the front controller script name, to link to files such as images.
PHP Code to Fetch Twitter Feeds
Fetch recent tweets with PHP and cURL and display them on a web page, with links made clickable.
Gmail Contact Grabber — PHP Class
A simple PHP class that fetches the contacts from a Gmail account using Google's ClientLogin API.