


Convert Color code from HEX to RGB using PHP
Today I am going to show an useful function that converts HEX to RGB of a color . Often we used directly the name of a color like "red","green","yellow" and sometimes we preferred to use the HEX code of a color like "#FFFFFF" for white or "#0000000" for black. However, If you want to use [...]
2 ways of printing an array in php
PHP provides two very useful functions that can be used to output a variable’s value recursively called print_r() and var_dump(). - Create An Array: $my_array = array("elem_1","elem_2","elem_3"); - Using Print_r() function: Print_r() can return its output as a string, as opposed to writing it to the scripts standard output print_r($my_array); // Output: // Array ( [...]
Array flip and reverse in php
array_flip function is quite useful when you only want to shift array index as array value and vice-verse. On the other hand, if you want to change only array index in descending/reverse order then array_reverse function works great. Array flip convert key in to index and index in to key. $a = array (0 => [...]