Tag Archives: php function

array_diff_key

Share(PHP 5 >= 5.1.0RC1) array_diff_key – Computes the difference of arrays using keys for comparison Description array array_diff_key ( array array1, array array2 [, array ...] ) array_diff_key() returns an array containing all the values of array1 that have keys that are … Continue reading

Posted in php | Tagged , , | Leave a comment

string to constant

Share constant (PHP 4 >= 4.0.4, PHP 5) constant – Returns the value of a constant Description mixed constant ( string name )constant() will return the value of the constant indicated by name. constant() is useful if you need to … Continue reading

Posted in php | Tagged , | Leave a comment

preg_match case insensitive

Share preg_match case insensitive <?php // The ”i” after the pattern delimiter indicates a case-insensitive search if (preg_match(“/php/i”, ”PHP is the web scripting language of choice.”)) {     echo ”A match was found.”; } else {     echo ”A match was not found.”; } ?>

Posted in php, regex | Tagged , , , | Leave a comment

file_get_contents vs fread

ShareThe main difference between a complete file read using fread and file_get_contents is that file_get_contents may use mmap (if your OS supports it) to use file memory mapping, which can eliminate a little of the copying and/or allocation of memory … Continue reading

Posted in php | Tagged , , , | Leave a comment

list alphabet using php

ShareI was looking for ways on how to list the alphabet without manually writing each one of them… I guess I found an answer here http://xqus.com/printing-alphabet-php. There were actually different methods being suggested. One that came from the author is … Continue reading

Posted in php | Tagged , , | Leave a comment