Monthly Archives: May 2014

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

Disable temporary a foreign key constraint in MySQL

snippets

Disable temporary a foreign key constraint in MySQL Were you in the situation of having a mysql table and wanted to delete some records from it, but you were not allowed due to the constraints of that table? Don’t worry, me too. Or if you use foreign keys in your database tables, you’ll probably have problems

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

How to detect a page refresh with PHP?

snippets

How to detect a page refresh with PHP? Sometimes you want to detect if the page was refreshed using “F5” key, or right click and “Reload” or any other method available. Either way, this can be detected somehow from server side. In this snippet, I will show you how to do this with PHP. Method

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

Request an article ←