ovi.ro

ovi.ro

Tag: php

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 Version7.0.0 – 7.1.35.4.4 – 5.6.305.2.1 – 5.4.3var_dump(‘123’ == ‘       123’);TRUETRUETRUEvar_dump(‘1e3’ == ‘1000’);TRUETRUETRUEvar_dump(‘+74951112233’ == ‘74951112233’);TRUETRUETRUEvar_dump(‘00000020’ == … Read more »

CheatSheet Sources

CheatSheets are pieces of paper that sum up some importat aspects of a topic.Searching for PHP, Javascript, jQuery, etc. cheatsheets on the internet I found some great resources out thereCheatography.com seems to be the biggest searchable cheatsheets, but also in pdf format, literally hundredsAddedBytes.com great summaries, some … Read more »

Syntax

PHP tagsPHP code must be put between some special characters<?php ?><? ?> // with short_open_tag enabled or php with option --enable-short-tags<script language="php"> </script> // old style<% %> // ASP style asp_tags enabledOther formats<?php echo 'message'; ?> // this are equivalents<?= 'message'; ?> // if short_open_tag … Read more »