¡@

Home 

php Programming Glossary: substr

Replace URLs in text with HTML links

http://stackoverflow.com/questions/1188129/replace-urls-in-text-with-html-links

the text leading up to the URL. print htmlspecialchars substr text position urlPosition position domain match 2 0 port match..

Best way to use PHP to encrypt and decrypt passwords? [duplicate]

http://stackoverflow.com/questions/1289061/best-way-to-use-php-to-encrypt-and-decrypt-passwords

iv To Decrypt data base64_decode encrypted iv substr data 0 mcrypt_get_iv_size MCRYPT_RIJNDAEL_256 MCRYPT_MODE_CBC.. mcrypt_decrypt MCRYPT_RIJNDAEL_256 hash 'sha256' key true substr data mcrypt_get_iv_size MCRYPT_RIJNDAEL_256 MCRYPT_MODE_CBC..

How to [recursively] Zip a directory in PHP?

http://stackoverflow.com/questions/1334613/how-to-recursively-zip-a-directory-in-php

' ' ' ' file Ignore . and .. folders if in_array substr file strrpos file ' ' 1 array '.' '..' continue file realpath..

How to extract a file extension in PHP?

http://stackoverflow.com/questions/173868/how-to-extract-a-file-extension-in-php

web with various answers ext end explode '.' filename ext substr strrchr filename '.' 1 ext substr filename strrpos filename.. explode '.' filename ext substr strrchr filename '.' 1 ext substr filename strrpos filename '.' 1 ext preg_replace ' ^. . ^. D'..

Convert one date format into another in PHP

http://stackoverflow.com/questions/2167916/convert-one-date-format-into-another-in-php

elements year month day hour minute second manually using substr and hand the results to mktime that will build you a timestamp...

How do you use bcrypt for hashing passwords in PHP?

http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php

function_exists 'openssl_random_pseudo_bytes' strtoupper substr PHP_OS 0 3 'WIN' OpenSSL slow on Win bytes openssl_random_pseudo_bytes.. true else bytes . pack 'H ' md5 this randomState bytes substr bytes 0 count return bytes private function encodeBytes input..

PHP 2-way encryption: I need to store passwords that can be retrieved

http://stackoverflow.com/questions/5089841/php-2-way-encryption-i-need-to-store-passwords-that-can-be-retrieved

false if it is not public function decrypt data key salt substr data 0 128 enc substr data 128 64 mac substr data 64 list cipherKey.. function decrypt data key salt substr data 0 128 enc substr data 128 64 mac substr data 64 list cipherKey macKey iv this.. data key salt substr data 0 128 enc substr data 128 64 mac substr data 64 list cipherKey macKey iv this getKeys salt key if mac..

Create Subdomains on the fly with .htaccess (PHP)

http://stackoverflow.com/questions/586129/create-subdomains-on-the-fly-with-htaccess-php

with www. or other subdomains then you could simply use a substring like so subdomain substr _SERVER 'SERVER_NAME' 0 strpos.. then you could simply use a substring like so subdomain substr _SERVER 'SERVER_NAME' 0 strpos _SERVER 'SERVER_NAME' '.' ..

How to Truncate a string in PHP to the word closest to a certain number of characters?

http://stackoverflow.com/questions/79960/how-to-truncate-a-string-in-php-to-the-word-closest-to-a-certain-number-of-chara

I can't display more than say 200 characters. I could use substr to chop off the text at 200 chars but the result would be cutting.. boundaries. After splitting you simply take the first line substr string 0 strpos wordwrap string your_desired_width n One thing.. string wordwrap string your_desired_width string substr string 0 strpos string n The above solution has the problem..

PHP startsWith() and endsWith() functions

http://stackoverflow.com/questions/834303/php-startswith-and-endswith-functions

needle 0 function endsWith haystack needle return needle substr haystack strlen needle needle var_dump startsWith hello world..