php Programming Glossary: substr_count
Match IPv4 address given IP range/mask? http://stackoverflow.com/questions/10421613/match-ipv4-address-given-ip-range-mask asParts explode ' ' network network @ asParts 0 nCount substr_count network ' ' network str_replace ' ' '0' network if nCount 1..
Detect EOL type using PHP http://stackoverflow.com/questions/11066857/detect-eol-type-using-php 400 cur_cnt 0 cur_eol default foreach eols as eol if count substr_count str eol cur_cnt cur_cnt count cur_eol eol return cur_eol Notes..
fgetcsv is eating the first letter of a String if it's an Umlaut http://stackoverflow.com/questions/12390851/fgetcsv-is-eating-the-first-letter-of-a-string-if-its-an-umlaut separator string for i 0 i count elements i nquotes substr_count elements i ' ' if nquotes 2 1 for j i 1 j count elements j.. i ' ' if nquotes 2 1 for j i 1 j count elements j if substr_count elements j ' ' 2 1 Look for an odd number of quotes Put the..
Get possible array combinations http://stackoverflow.com/questions/18961122/get-possible-array-combinations iPos 1 '0' return substr sAssoc 0 iPos 2 . str_repeat '0' substr_count substr sAssoc iPos 2 '0' . str_repeat '1' substr_count substr.. '0' substr_count substr sAssoc iPos 2 '0' . str_repeat '1' substr_count substr sAssoc iPos 2 '1' return false function getAssoc array..
Validate date format in php http://stackoverflow.com/questions/2086598/validate-date-format-in-php function _date_is_valid str if strlen str 0 return TRUE if substr_count str ' ' 2 if preg_match ^ 31 0 13578 1 02 29 30 0 1 3 9 1 0.. str 0 To accept entries without a date return TRUE if substr_count str ' ' 2 list d m y explode ' ' str if y 10 y 30 y 2010 y.. improve this question function _date_is_valid str if substr_count str ' ' 2 list d m y explode ' ' str return checkdate m d sprintf..
Efficiently counting the number of lines of a text file. (200mb+) http://stackoverflow.com/questions/2162497/efficiently-counting-the-number-of-lines-of-a-text-file-200mb feof handle line fgets handle 4096 linecount linecount substr_count line PHP_EOL fclose handle echo linecount share improve this..
PHP image upload security check list http://stackoverflow.com/questions/4166762/php-image-upload-security-check-list die 'error 2' check double file type image with comment if substr_count filetype ' ' 1 die 'error 3' upload to upload direcory uploaddir..
Working with IPv6 Addresses in PHP http://stackoverflow.com/questions/444966/working-with-ipv6-addresses-in-php strpos Ip ' ' false Ip str_replace ' ' str_repeat ' 0' 8 substr_count Ip ' ' .' ' Ip if strpos Ip ' ' 0 Ip '0'. Ip return Ip Convert..
PHP cache control doesn't seem to work http://stackoverflow.com/questions/6161864/php-cache-control-doesnt-seem-to-work I have put a PHP header in the top of my HTML page php if substr_count _SERVER 'HTTP_ACCEPT_ENCODING' 'gzip' ob_start ob_gzhandler..
|