php
-
I recently found myself needing to enforce color values in a hex code format after discovering a mix of hex codes and CSS color names in my data. The easiest way to do this was to build a static map. My application is built with PHP so I needed to get the full list of…
-
PHP’s preg_filter function is great for filtering array elements that match a given expression. Let’s look at an example usage that subdivides an array.
-
Use preg_filter to quickly add a prefix or suffix to all strings in an array.