Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Simon Holywell:
PHP date localisation with setlocale
Jul 21, 2015 @ 12:57:07

Simon Holywell as written up a tutorial for his site showing you how to use setlocale to do PHP date localization.

Localising sites can be a chore, but PHP has the venerable setlocale() to use system locales. These are like templates or profiles that describe how various types of data should be displayed. Should a price have a comma or point to indicate the decimals? When printing a date should PHP output Monday or Montag?

All of these considerations are locale specific and they map to a geographical area. Various cultures have their own standards for displaying this kind of information not to mention different languages to accommodate.

He shows how to find the locales your system supports and how to install them if the one(s) you need are missing. With it correctly installed, the system knows how to use it but PHP needs a little extra help. With a call to the setlocale method and the use of a special date string modifier (in this case "%B" for the month name) PHP knows to use the locale-aware version of the data...but only with strftime not the normal PHP date handling.

tagged: simonholywell setlocale locale localization strftime

Link: https://www.simonholywell.com/post/2015/07/php-date-setlocale-localisation/

php[architect]:
Functional Programming in PHP Release
Sep 08, 2014 @ 11:14:22

While not a mainstream practice in the PHP world, functional programming has been a topic that's popped up again and again over the years. If you've ever wondered what it's all about and how to get started with it in your applications, take a look at php[architect].

This book is for anyone that has an interest in functional programming or PHP as an advanced programming language. If you are curious or have never even heard of functional programming before then this is the gentle introductory text you have been looking for. Equally it serves those seeking to exploit the advanced functional concepts such as monads in a PHP context.

This book comes from some of the experience Simon has had with functional programming in the past (and taught about in presentations). It provides examples showing the techniques of functional programming applied in PHP including: map/reduce, currying and composition. The book can be purchased either directly from php[architect] or from Amazon (or Amazon.co.uk).

tagged: functional programming release book phparchitect simonholywell

Link: http://www.functionalphp.com

Three Devs & A Maybe Podcast:
Functional Programming with Simon Holywell
Jul 23, 2014 @ 11:03:45

Three Devs & A Maybe podcast has released their latest episode today: Episode #35 - an interview with Simon Holywell. Simon is the author of an upcoming book about functional programming in PHP.

This week we are lucky to have Simon Holywell on the show to talk all things Functional Programming. Initially starting off with a concrete definition of Functional Programming, we move on to a brief history of the paradigm and immutability. Following this we explain recursion (and tail-recursion), along with closures and higher-order functions. From this base we are able to then talk about the different languages available to you which cater towards the functional mindset (i.e. Haskell). We then set our sights on the PHP language and what/wish it had to offer when exploring the functional paradigm. Finally, we mention his upcoming book, along with experiences presenting at user-group meet-ups.

Topics mentioned in this episode include:

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly.

tagged: threedevsandamaybe podcast ep35 simonholywell functional php

Link: http://threedevsandamaybe.com/posts/functional-programming-with-simon-holywell/