PHP Basics: Accessing Remote URLs using cURL

In this post, I’m going back to basics to talk about accessing remote URLs with cURL.
In PHP, there are actually four ways to access a remote URL – fopen() fsockopen(), cURL extensions and HTTP_Request class from the PEAR library. Now, choosing one way over another really depends on your needs for simplicity, control, and portability. [...]

Posted on June 19, 2009 at 4:40 pm by Eldee · Permalink · 6 Comments
In: PHP Tutorials · Tagged with: , ,

CakePHP: Using scaffolding for rapid application building

That’s right, I’m still on my CakePHP journey. I’ve been spending quite a bit of time now trying to match what I want to build with how to go about doing it in CakePHP. We all know that the blog example is pretty simplistic – a real world app won’t be quite so straightforward. At [...]

Posted on May 20, 2008 at 4:18 pm by Eldee · Permalink · 4 Comments
In: PHP Tutorials · Tagged with: ,

CakePHP: Working with ‘Associations’

This is probably going to be the first of many postings of my exploration with CakePHP. This post will briefly look at the CakePHP’s ‘Associations’ feature. Associations is “the relational mapping provided by the [CakePHP] model”.
In non-Cake speak, we’re talking about standard SQL joins – the mapping of relations between SQL tables. As you may [...]

Posted on May 8, 2008 at 5:48 pm by Eldee · Permalink · 12 Comments
In: PHP Tutorials · Tagged with: ,

Creating simple graphs using Google Charts API

Thinking back a fews years ago, I was involved in building some reporting modules with graphs and charts to show our customer utilisation of our data center. After trying a number of different open source graphing packages for PHP, I finally found JpGraph, which I daresay is probably the best graphing package available for [...]

Posted on April 24, 2008 at 3:39 pm by Eldee · Permalink · 3 Comments
In: PHP Tutorials · Tagged with: , ,

Using regular expressions to extract content

PHP provides a number of really neat regular expression functions. You can find the list of the regex function at the PHP site.
But the one that I’ve had most fun with is the preg_match_all() function which I’ve been using to do content extraction from an HTML page.

Posted on April 22, 2008 at 7:03 pm by Eldee · Permalink · 16 Comments
In: PHP Tutorials · Tagged with: , ,

Parsing a URL querystring into variables in PHP

It’s common knowledge you can read variable from a URL querystring by using $_GET array in PHP, but that’s only possible if the URL is “executed” in the browser.
For those who might not know, querystrings are those variable-value pairs that appears behind ‘?’ of a URL. For example,
http://www.mysite.com/index.php?variable1=1&variable2=1
gives the querystring “variable1=1&variable2=1″.
What happens if [...]

Posted on April 17, 2008 at 4:16 pm by Eldee · Permalink · One Comment
In: PHP Tutorials · Tagged with: , ,

Checking a string is alphanumeric in PHP

There may be times when you need a way to check that a string only contains alpha-numeric characters. That means only alphabets A-Z and numbers 0-9.
Most PHP-ers will probably use regular expressions and the function preg_match(). I will admit that regular expressions is really powerful, but it’s a real pain to learn and master. Fortunately [...]

Posted on April 11, 2008 at 4:18 pm by Eldee · Permalink · 10 Comments
In: PHP Tutorials · Tagged with: , ,

PHP Operators: Assignment

The main assignment operator is ‘=’, which basically assigns a value on the right to a variable on the left. If you think this is the same as an equal sign in mathematics, don’t! Think of it as a ‘assigned to’ so whatever is on the right is assigned to the left.
Here’s a simple [...]

Posted on February 11, 2008 at 4:58 pm by Eldee · Permalink · Leave a comment
In: PHP Tutorials · Tagged with: , , ,

PHP Operators: Maths

There are various kinds of operators used in PHP, but we’re going to start with the most basic and commonly known operator – the Math operators.
What are operators? They are basically a special set of characters (or symbols, if you like) which tells PHP to perform a certain operation. For example, the ‘+’ (plus sign) [...]

Posted on January 31, 2008 at 5:32 pm by Eldee · Permalink · Leave a comment
In: PHP Tutorials · Tagged with: , , ,

Using XAMPP Lite for PHP scripting

Now that you know how to setup your XAMPP Lite, it’s time to find your way around XAMPP Lite, and get ready for your first PHP script.
This post will highlight some of the features available in XAMPP, and what you do with them. It’s just a simple overview, so don’t expect anything in detail. [...]

Posted on January 8, 2008 at 5:38 pm by Eldee · Permalink · 3 Comments
In: PHP Tutorials · Tagged with: , ,