background preloader

PHP

Facebook Twitter

Recherche sa-son Lead Développeuse-eur Wordpress / PHP ! A Guide on Advanced Logging and Benchmarking with FirePHP. In a previous article, we discussed FirePHP’s basic logging functions for debugging your PHP web applications. Although–as we have seen–it can be used for debugging purposes, its main utility is to log information about your web apps, and it does a terrific job in that regard. In this article, I will introduce you to an old concept that seems to be forgotten by most web developers today: the importance of logging. Additionally, I’ll walk you through some of functions designed to keep your logging more organized. We will talk about: Grouping messagesTablesBenchmarking your code We’ll also learn how to redirect trappable PHP errors to FirePHP, which is a neat and very convenient feature. The importance of logging While debugging is essential to ensure an application works, it does not explain why, for example, a user is having trouble subscribing to your newsletter when other users can.

Unfortunately, many web developers tend to disregard logging, making bug squashing a lot harder. Tables. 15 PHP regular expressions for web developers. Getting started with regular expressions For many beginners, regular expressions seems to be hard to learn and use. In fact, they’re far less hard than you may think. Before we dive deep inside regexp with useful and reusable codes, let’s quickly see the basics: Regular expressions syntax PHP regular expression functions Validate domain name Verify if a string is a valid domain name.

$url = " if (preg_match('/^(http|https|ftp)://([A-Z0-9][A-Z0-9_-]*(? » Source Enlight a word from a text This very useful regular expression find a specific word in a text, and enlight it. $text = "Sample sentence from KomunitasWeb, regex has become popular in web programming. Enlight search results in your WordPress blog As I just said that the previous code snippet could be very handy on search results, here is a great way to implement it on a WordPress blog. Echo $title; Now, just before the modified line, add this code: <? Save the search.php file and open style.css. » Source » Source 'A(? <? Hypertext Preprocessor. PEAR - PHP Extension and Application Repository.

My PHP Classes page.