Nabil Kadimi

Freelance Web Developer – Morocco

Main menu

Skip to content
  • Blog
  • Freelance Services
  • Portfolio
  • Request a quote
  • About Me

Category: PHP

PHP answers and tips

The right question is: Is it empty?

PHP: empty() is your friend

November 12, 2012

It’s easy to miss things that are very obvious, this is the proper way to check that a variable has a value that is not nothing (null, 0, FALSE, “false”, array(), etc) without getting PHP E_NOTICE messages (that I encourage … Continue reading →

Posted in PHP | Reply

PHP MVC tutorial for beginners – Part 1: What is MVC?

May 26, 2012

The MVC design pattern separates business logic from user interface Model–View–Controller is a design pattern or a software engineering concept that separates the model, the view and the controller from each others, thus dividing the labour in your application in … Continue reading →

Posted in PHP | Replies: 3

PHP: remove an array item by value

October 1, 2010

It isn’t quite obvious to remove an array item when all you know is the value of that item, – i.e. you don’t now the item index. Remove items without preserving original indexes $the_array = array_values(array_diff($the_array,array($the_value))); // Example $the_array = … Continue reading →

Posted in PHP | Replies: 3

PHP with IMAP on CentOS

March 15, 2010

I was playing with Drupal 6 and some UberCart ticket module when I came across an error message where Drupal told me that it needed the IMAP PHP extension to be installed. Because I’m a nice guy I will share … Continue reading →

Posted in CentOs, PHP | Reply

Get current URL in PHP

March 8, 2010

Here is a function for getting the URL of the page being processed in PHP, the function accepts one optional parameter $ignore_port_80 (boolean) to tell it whether it should ignore the port part of the url if the port used … Continue reading →

Posted in PHP | Reply

Install Symfony Without PEAR

January 27, 2010

A lot of web hosts have limited or nonexistent support for PEAR, the pear command will throw errors on most commands or not work at all, in order to install Symfony on such hosts you will need to download the … Continue reading →

Posted in PHP, Software | Reply

How to check a file type efficiently in PHP?

August 7, 2009

The Problem Do you know a method in PHP to check the type of an uploaded file without relying on extension or Mime-type because these two can be faked? Verifying the file type in PHP Relying on the Mime-type of … Continue reading →

Posted in PHP | Replies: 3

Print HTML code from JavaScript variable

August 5, 2009

This also was about to drive me crazy so I will not let it go without writing about it.. Let’s say you have some long HTML code contained on a PHP variable, something like this <?php $some_div = ‘ <div … Continue reading →

Posted in JavaScript, PHP | Reply

Get file extension on PHP

August 4, 2009

There are many ways to retrieve files extension with PHP, but we will have to choose one that feets our needs and gives more reliable results. When dealing with file extension you should know that a file extension is not … Continue reading →

Posted in PHP | Reply

Install PHP 5.2.6 on CentOs 5.x

June 24, 2009

Oddly enough, PHP 5.2.6 is still not available on the default CentOS repositories ([base], [updates], [addons], and [extras]), the latest PHP version available in those repos is PHP 5.1.6! In order to install PHP 5.2.6 you can add the CentOS … Continue reading →

Posted in CentOs, PHP | Reply

Post navigation

← Older posts
  • Français
  • English

Nabil KADIMI

I'm Nabil Kadimi, I'm a freelance web developer, I make nice websites using Drupal, Wordpress, Joomla, jQuery and more.

Contact me

→ By email: Use this form
→ By phone: +212.6.65.80.24.25
→ On Skype: nabil_kadimi

Don't miss my next blog post

Subscribe to Nabil KADIMI RSS feed Follow Nabil KADIMI on Twitter Add Nabil KADIMI to your Google+ circles

Blog categories

  • Featured
  • PHP
  • MySQL
  • Linux
    • Ubuntu
    • CentOs
  • CMS
    • Drupal
    • WordPress
    • Joomla
  • Webdesign
    • CSS
    • JavaScript
    • JQuery
  • SEO
  • Web Hosting
  • Software
    • Reviews
  • Quotes I like
© 2009 – 2013 Nabil Kadimi