PHP

PHP is the server side programming language used by a lot of developers around the globe. It is also a general purpose programming language.


PHP Smarty var_dump alternative and prestashop errors

var_dump

PHP Smarty var_dump alternative and prestashop errors If you work on prestashop for example, and you want to make a debug for all or a certain variable from within a page you will have problems because you cannot use var_dump since Smarty is a templating language for PHP. Method 1

Method 2

Method

Transform a csv file to associative array in PHP

csv

 Transform a csv file to associative array in PHP There are a lot of  examples on how to take a CSV file and put it in an array, but the main problem about them is that the header and the rest of the content from the csv are placed on separate keys, both on the

Working with Entities in Symfony2

Working with Entities in Symfony2 Symfony is a very powerfull PHP framework that helps you do amazing projects in small amount of time. It has built in support for Doctrine which is an incredible tool for interacting with databases, not through tables but through php objects. First let’s see what is an ORM and after that

How to do a batch insert in MySQL?

mysql feature

How to do a batch insert in MySQL? In this tutorial, I will present you how to do a batch insert in mysql. Let’s say you want to insert some informations from an array into the database. In order for this to work efficient, you should have more than one information in that array. Why

How to sort a multidimensional array based on key?

snippets

How to sort a multidimensional array based on key? First of all, let’s give credit to the person who wrote this function. The problem ? Let’s say you have a multidimensional array and you want to sort based on a key that is not on the first level of the array, how would you do

6 free mobile device emulators for testing your app

responsinator

6 free mobile device emulators for testing your app If you made at least one website that was responsive, you certainly know how important these tools are. Here is a list with helpful websites in which I tested my apps during and after development. This is NOT a top, just a list. 1) Responsinator Responsinator

Remove html tags and malicious content in php

malicious

Remove html tags and malicious content in php Let’s say you have some data that are coming from the client side (a form submit, an ajax call, etc) and you want to be sure that you are not inserting in the database malformed data with html tags or other stuff. In the end you would need

Security risk using register_globals

php code

Security risk using register_globals There’s a security risk involved when enabling in your server register_globals, not sure if any of you noticed but I just remembered this and thought I should shout it to you all just so you are more careful. I’m currently working on a little project, not sure what will come out of

How to change php timezone on your server

Timezone map

How to change php timezone on your server Normally when using a shared hosting service, the server you are being hosted on has a different timezone set. So your scripts may be displaying a different time than what you expect. Fixing this is not hard at all, however some users think that the server timezone

Request an article ←