Category Archives: PHP

PHP FILTER VALIDATION

Filter The Special Characters Validate Integer: FILTER_VALIDATE_INT Validate Integer With Range: FILTER_VALIDATE_INT Validate Email: FILTER_VALIDATE_EMAIL Validate Email With _GET Method: FILTER_VALIDATE_EMAIL Validate Integer With _POST Method: FILTER_VALIDATE_INT   Filter The Special Characters <?php $String=”asdf-32^3###3sa435r”; $String=preg_replace(‘/[^a-zA-Z0-9_ -]/s’, ”, $String); echo $String; /** output **/ asdf-3233sa435r ?> Validate Integer: FILTER_VALIDATE_INT <?php $int = “123”; if(!filter_var($int, FILTER_VALIDATE_INT)) { […]

PHP Variable

What is Variable? Rules For Variable Variable Types Constant Predefined Variables What is Variable? PHP6 introduce 64bit integer A variable is a representation of particular value. Simplay we can call this “containers” for storing information. By assinging a value to variable, you can reference the variable in other places in your script and we can […]

PHP String count_chars

Syntax:mixed count_chars ( string $string [, int $mode = 0 ] ) Description:count_chars — Return information about characters used in a string.Counts the number of occurrences of every byte-value (0..255) in string and returns it in various ways. Return Values: 0 – an array with the byte-value as key and the frequency of every byte as value. 1 […]

PHP Sort

Syntax: bool sort ( array &$array [, int $sort_flags = SORT_REGULAR ] ) Description: Sort an array <?php $fruits = array(“lemon”, “orange”, “banana”, “apple”); sort($fruits); print_r($fruits); ?> OUTPUT Array ( [0] => apple [1] => banana [2] => lemon [3] => orange )  

PHP Variables And Constant

What is Variable? Rules For Variable Variable Types Constant Predefined Variables What is Variable? PHP6 introduce 64bit integer A variable is a representation of particular value. Simplay we can call this “containers” for storing information. By assinging a value to variable, you can reference the variable in other places in your script and we can change […]