Home  >  Article  >  Backend Development  >  The most complete collection of commonly used PHP functions in history, you will be out if you don’t take a look (it will be continuously updated!)_PHP Tutorial

The most complete collection of commonly used PHP functions in history, you will be out if you don’t take a look (it will be continuously updated!)_PHP Tutorial

WBOY
WBOYOriginal
2016-07-20 11:14:581173browse







sub_str(, = 0, = = (); = ( ( == 0 || >= ( < 0 = + ( < 0 = (('mb_substr' = mb_substr(, 0, , (('iconv_substr' = (, 0, , = (, 0, ( && != .= '...' } View Code

2、获得用户的真实IP地址

The most complete collection of commonly used PHP functions in history, you will be out if you don’t take a look (it will be continuously updated!)_PHP Tutorial = ( !== (( ((['HTTP_X_FORWARDED_FOR' = (',', ['HTTP_X_FORWARDED_FOR' ( = ( ( != 'unknown' = ((['HTTP_CLIENT_IP' = ['HTTP_CLIENT_IP' ((['REMOTE_ADDR' = ['REMOTE_ADDR' = '0.0.0.0' (('HTTP_X_FORWARDED_FOR' = ('HTTP_X_FORWARDED_FOR' (('HTTP_CLIENT_IP' = ('HTTP_CLIENT_IP' = ('REMOTE_ADDR' ("/[d.]{7,15}/", , = !([0]) ? [0] : '0.0.0.0' } View Code

3、计算字符串的长度(汉字按照两个字符计算)

The most complete collection of commonly used PHP functions in history, you will be out if you don’t take a look (it will be continuously updated!)_PHP Tutorial str_len( = (('/[x00-x7F]/', '', ( () - + ( / 3) * 2 ( } View Code

4. Obtain the newline character of the user's operating system

The most complete collection of commonly used PHP functions in history, you will be out if you don’t take a look (it will be continuously updated!)_PHP Tutorial ((['HTTP_USER_AGENT'], 'Win' = 'rn' ((< span $_SERVER['HTTP_USER_AGENT'], 'Mac' = 'r'; = 'n' } View Code

5. Send email

The most complete collection of commonly used PHP functions in history, you will be out if you don’t take a look (it will be continuously updated!)_PHP Tutorial send_mail(, , , , = 0, = (['_CFG']['mail_charset'] != = ecs_iconv(EC_CHARSET, ['_CFG']['mail_charset'], = ecs_iconv(EC_CHARSET, ['_CFG']['mail_charset'], = ecs_iconv(EC_CHARSET, ['_CFG']['mail_charset'], = ecs_iconv(EC_CHARSET, ['_CFG']['mail_charset'], ['_CFG']['shop_name' = ['_CFG']['mail_charset' (['_CFG']['mail_service'] == 0 && ('mail' = ( == 0) ? 'Content-Type: text/plain; charset=' . : 'Content-Type: text/html; charset=' . = [] = 'From: "' . '=?' . . '?B?' . () . '?='.'" <' . ['_CFG']['smtp_mail'] . '>' [] = . '; format=flowed' ( [] = 'Disposition-Notification-To: ' . '=?' . . '?B?' . () . '?='.'" <' . ['_CFG']['smtp_mail'] . '>' = @(, '=?' . . '?B?' . () . '?=', , ("rn", (! ['err'] ->add(['_LANG']['sendemail_false' = ( == 0) ? 'Content-Type: text/plain; charset=' . : 'Content-Type: text/html; charset=' . = ( = [] = 'Date: ' . ('D, j M Y H:i:s') . ' +0000' [] = 'To: "' . '=?' . . '?B?' . () . '?=' . '" <' . . '>' [] = 'From: "' . '=?' . . '?B?' . () . '?='.'" <' . ['_CFG']['smtp_mail'] . '>' [] = 'Subject: ' . '=?' . . '?B?' . () . '?=' [] = . '; format=flowed' [] = 'Content-Transfer-Encoding: base64' [] = 'Content-Disposition: inline' ( [] = 'Disposition-Notification-To: ' . '=?' . . '?B?' . () . '?='.'" <' . ['_CFG']['smtp_mail'] . '>' ['host'] = ['_CFG']['smtp_host' ['port'] = ['_CFG']['smtp_port' ['user'] = ['_CFG']['smtp_user' ['pass'] = ['_CFG']['smtp_pass' ((['host']) || (['port' ['err'] ->add(['_LANG']['smtp_setting_error' (!('fsockopen'

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn