Just read a comment in the PHP documentation and had another PHP madness moment. It seems you have to be really, really careful when comparing strings that include numbers… Command \ PHP Version 7.0.0 – 7.1.3 5.4.4 – 5.6.30 … Read more »
Posted on : 2016-02-25 | Category :
PHP Basics | Tags :
When you put the a case block after the default block the switch will work normally and fallback to the default only after testing all cases. The documentation doesn’t specify this directly, but there is a note with an example. … Read more »
Posted on : 2015-09-04 | Category :
Security | Tags :
Great photos explaining what is disclosed at each point when doing a request on the web, with or without Tor or HTTPS. The photo is provided by the EFF https://www.eff.org/pages/tor-and-https
Posted on : 2015-05-28 | Category :
Sadness | Tags :
What would you expect for this script to output? error_reporting(E_ALL); ini_set(‘display_errors’,1); $text = “abc”; var_dump(isset($text[‘key’])); var_dump((bool) $text[‘key’]); Maybe a notice? maybe some false there.. But if you have in mind PHP logic.. you surely know.. So, $text is a string … Read more »
Posted on : 2015-05-28 | Category :
Sadness | Tags :
If you iterate over an array with & you should unset the value variable after to not modify the array accidentally after. $array = array(‘a’, ‘b’, ‘c’, ‘d’); foreach($array as $key=>&$value) { if ($key = 3) { // change d … Read more »
Posted on : 2015-05-19 | Category :
Sadness | Tags :
Working with echo or print is very easy in PHP. At the begining it might be harder to understand concatenations or operations order, but after you master them is really easy. But there are some cases where you wonder how … Read more »
Documentation Cheatsheet: Dave Child, Dzone, RegexOne Tools: (Online) RegExr, Regex101, RagexPal, RegexPlanet, (Offline) Rad Software (free) or RegexBuddy (paid)
In a competitive environment as the programming world is this kind of certification can help you differentiate yourself when you are looking for a job. You might want a bigger salary, you want to improve your CV, the certification is … Read more »
Variables are preceded in PHP by a dollar sign $ and the rules for naming are: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* or in plain english names of variables can begin with letters or underscores and then you can put other numbers letters and underscores. Letters here … Read more »
PHP Operators precedence and exceptions … Read more »