Author Archives: maximem
Speed up your sessions, part 2 – Performance
If it's not already done, I suggest you to read the first part of this serie of two posts to learn how to use properly PHP sessions. Well, now that everyone knows what to do and not do with sessions, we ...
- Tags : memcached | performance | sqlite
- Comments Off
- Share On Twitter
Reorder numeric keys of an array from “0″ onwards
Back in the game with another PHP quick tip :) Ever faced the problem of needing to loop through an array but it has non-consecutive numeric keys ? There are some easy ways to reassign array keys from 0 onwards. Supposing that I ...
Make objects iterable and countable using the SPL, part 1
Since its 5th version, PHP brings a full object model and offers a lot of features for OOP (Object-oriented programming). Unlike PHP 4, PHP 5 implements concepts such as visibility (public, private, protected), abstract classes and methods, interfaces... Moreover, it provides ...
Get the number of days in a month
Ever wonder how many days there are in a specific month ? Your quest is over, I have what you need : the cal_days_in_month() function from the Calendar PHP extension. This function can work with different calendars : gregorian, julian, jewish... ...
- Tags : calendar | date | day | month
- Comments Off
- Share On Twitter
Validate and sanitize data with PHP Filter, part 1
When coding websites or web applications, working on security is important. To prevent all kinds of injections (XSS, SQL, CSRF...), you have to check all data coming from a foreign source. The typical example is when a user send data ...





Recent Comments