- Posting to Twitter Using the load() Function for PHP
- Due to the super simple API that's provided by twitter, its very easy to post to Twitter. And thats made even simpler by using the load() function. As simple as this...
- PHP Function to Check Domain Availability
- This function will check for the availability of the domain you gave as the argument. Note: This script will only work in Linux system - it uses the
whoiscommand to do the lookup.
- Image Class - GD Wrapper
- This is a wrapper class for the GD Library in PHP. You can use this to manipulate images. Please note that you must have GD installed in the server for this class to work as advertised.
- joinPath() - Combines Multiple Path Fragments
- This function will combine all the path fragments provided as the argument and return the result. joinPath() will use the correct path separator for the current platform.
- SqlPager PHP Class
- SqlPager PHP class make paging very simple - just provide it with the query to page, and it will do the rest. It uses the LIMIT keyword to do this. Currently, it support only MySQL.
- ls() - Return Folder Contents
- The ls() function will take a pattern and a folder as the argument and go thru it(recursively if needed)and return the list of all files in that folder.
- Functions to Import/Export CSV data
- These two function make it very easy to import and export CSV in PHP.
- PHP Function to Create URLs - getLink()
- getLink() is a function that will make creating URLs much easier. This function expects two arguments - the first argument is the URL and the second one is an array with all the parameters that should be passed with the URL. The function will combine the existing URL with the parameter array and return the resulting URL.
- load() Function for PHP - Fetch URL Content
I recently had to develop a small script that will fetch an XML file from the web. All I had to do is download a given URL and read its contents. To my great surprise I found that download the file using my jx Ajax library was much easier than doing it with PHP.
PHP make this very easy by including functions like file_get_contents() that has URL support. Unfortunately, this is a huge security threat - and many servers have disabled this feature in PHP. PHP provide other two method to fetch an URL - Curl and Fsockopen. But to use this I have to write a lot more code. So I decided to create my own function that makes it much more easier.
- iFrame PHP Framework
- iFrame is my PHP framework - developed for personal use and distributed under the BSD License. I will not recommend using this framework for your projects.
- Upload Function
- Uploading a file using PHP is not a single step function. To make this easier, I have created a function that will upload a file with just one function call. Just
upload('image');and the file is uploaded! upload() is a function that makes uploading files very easy.
- Element Deletion from Array
- Dump() Function - Formated print_r()
- The print_r() is a very valuable function for all PHP developers. However, there is two problems with this function -
- xml2array() - XML Parser for PHP
- array2json() - Convert PHP arrays to JSON
- Benchmarking Script - Timer
- Time the execution of your script using this simple script.
- sql2json() - Converts SQL Results to JSON String
- sql2json() converts the result of the given SQL query to its equivalent JSON string.
- Query() Function
- query() function will accept a query as its argument and return the data in different formats based on the result of the query.