-
15.08.11 - Extending Twig in Symfony 2, add custom functions
Sometimes we need to add some custom functions to the view. In Symfony 1 we have the helpers, in Symfony 2 we must extend Twig in order to add it.At first, we have to connect our future Twig extension to the Dependency Injection Container in our Bundle. If we don't got any config file we have to [...]
-
14.05.11 - PHP function for spanish DNI validation
-
15.11.10 - Download your Tuenti albums and photos with PHP
The first step must be and .The download script is very simple (included into the examples of the API): There was defined some constants in the head of the file in order to configure more easily the script. The API gives us the photos 20 by 20, that is the reason why we use the method .
-
24.05.10 - Integrate GeSHi with PHP applications
GeSHi (GEneric Syntax HIghlighter) is a popular PHP library for syntax highlighting for multiple programming/markup languages. There are multiple forms for integrate it with our PHP application, one of these is using regular expressions.Warning: GeSHi consumes high processing time, be careful. You [...]
-
03.04.10 - Short URL's through j.mp or bit.ly API with PHP
First, in order to use the bit.ly API, you must and . Once done, with cURL we can short a URL calling the next simple PHP function:
-
21.12.09 - Learn PHP quikly with Java and C knowledge
PHP Object Oriented is like than Java and procedimental form like C. The previous knoledge of one of those can save a lot of PHP learning time. In Java: In PHP: PHP procedural programming is slightly different from C. A hello world example in C is like: in PHP: