0v1.ro

(zero V unu)

Category Archives: Sadness

A little bit of PHP sadness

Compare strings in PHP

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 »

Strings array access issue

What would you expect for this script to output?

Maybe a notice? maybe some false there.. But if you have in mind PHP logic.. you surely know.. So, $text is a string and string characters can be accessed with … Read more »

Foreach with reference

If you iterate over an array with & you should unset the value variable after to not modify the array accidentally after.

Should do like this

PHP echo print question

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 »