Category Archives: Usefull PHP

PHP Tutorial : Validate email address – simple way with filter_var() function

While browsing php.net without any scope I discovered a very cute & nice way to replace the usual regular expression email checking thing. That way is via filter_var() php function which does the things 10 times faster : <?php $email … Continue reading

Posted in Usefull PHP | Tagged , | Leave a comment

PHP Tutorial : Write text and convert into image

The base usage in my mind when I write this tutorial to convert text into image with php is to write email into images dinamically to avoid spammers collecting such addresses from the internet. To run such a script you … Continue reading

Posted in Usefull PHP | Tagged , , , , , | Leave a comment

PHP Tutorial : Get Browser Name & It’s Capabilities

To get browser name just use next thing : <?php print $_SERVER['HTTP_USER_AGENT']; ?> And for all the features of browser user : <?php print_r(get_browser(null, true));//null for user agent &amp; true to return array ?>

Posted in Usefull PHP | Tagged , , , , , , , | Leave a comment

PHP Tutorial : Country list array

In my point of view, a very usefull and common thing we need when we build for example a membership site it’s country list array. I will do it within next function then will show how to use it : … Continue reading

Posted in Usefull PHP | Tagged , , , , , , , | Leave a comment

PHP Tutorial : List function

Beeing surprised that I didn’t write here about this “cute” php function called list(). I like it a lot, it’s like the extract() function in some way if you remember. The list() php function will assign variables in one shot … Continue reading

Posted in Usefull PHP | Tagged , , , , | Leave a comment

PHP Tutorial : Get Protocol

I saw this problem/question on a few forums and I finded it useful to post on my blog too due to low results on google that gives you what you need. So,  how to get the protocol of a URL … Continue reading

Posted in Usefull PHP | Tagged , , , , , | Leave a comment

PHP Tutorial : Ctype character type checking

Happy 1st June for those under 18 Yesterday I’ve found a nice function in php called ctype. And? What it does? Well, I see it as a replacement for regular expressions. PHP Ctype function checks for character type. Let’s hear … Continue reading

Posted in Usefull PHP | Tagged , , , , , , , , , , , , , , , | Leave a comment

PHP Tutorial : Get line number

As you might know, PHP Server comes with built-in / already defined constants. Today I’ve been discovering a nice one which gets the line number in a file for you. This may be very usefull in a lot of cases, … Continue reading

Posted in Usefull PHP | Tagged , , , , , | Leave a comment

PHP Tutorial : Extract function

A shame for me but I must tell you this function called extract() simply rocks : it will extract “keys” from an array and convert them into variables, so no more needed to manually declare variables for validation purposes from … Continue reading

Posted in Usefull PHP | Tagged , , | 3 Comments

PHP Tutorial : Create a RSS / XMLS Feed

Welcome, In this tutorial I will show you how to create a basic rss / xml feed with php. Basically, if you know how to create a feed in notepad, wordpad or whatever text editor, this will be easy. The … Continue reading

Posted in Usefull PHP | Tagged , , , , , , , , , , , , , | Leave a comment