PHP-基础
    - 介绍
 - 本地环境安装
 - 安装 WNMP 环境
 - 代码编辑器选择
 - 语法
 - 变量与常量
 - 常见输出函数
 - 数据类型之四种标量类型
 - 数据类型之三种复合类型
 - 数据类型之两种特殊类型
 - Operators:运算符
 - 流程控制:条件判断语句
 - 流程控制:循环语句
 - 流程控制:中止语句
 - 函数
 - 类和对象:基本概念
 - 类和对象:类结构
 - 类和对象:面向对象
 - 类和对象:三种特殊类
 - 类和对象
 - 类和对象:Trait
 - 类和对象:魔术方法
 - 命名空间
 - 【实战】PHP表单
 
PHP-函数
    - 
                        String
- addcslashes()
 - addslashes()
 - bin2hex()
 - chop()
 - chr()
 - chunk_split()
 - convert_cyr_string()
 - convert_uudecode()
 - convert_uuencode()
 - count_chars()
 - crc32()
 - crypt()
 - echo
 - explode()
 - fprintf()
 - get_html_translation_table()
 - hebrev()
 - hebrevc()
 - hex2bin()
 - htmlentities()
 - htmlspecialchars()
 - htmlspecialchars_decode()
 - html_entity_decode()
 - implode()
 - join()
 - lcfirst()
 - levenshtein()
 - localeconv()
 - ltrim()
 - md5()
 - md5_file()
 - metaphone()
 - money_format()
 - nl2br()
 - nl_langinfo()
 - number_format()
 - ord()
 - parse_str()
 - printf
 - quoted_printable_decode()
 - quoted_printable_encode()
 - quotemeta()
 - rtrim()
 - setlocale()
 - sha1()
 - sha1_file()
 - similar_text()
 - soundex()
 - sprintf()
 - sscanf()
 - strcasecmp()
 - strchr()
 - strcmp()
 - strcoll()
 - strcspn()
 - stripcslashes()
 - stripos()
 - stripslashes()
 - strip_tags()
 - stristr()
 - strlen()
 - strnatcasecmp()
 - strnatcmp()
 - strncasecmp()
 - strncmp()
 - strpbrk()
 - strpos()
 - strrchr()
 - strrev()
 - strripos()
 - strrpos()
 - strspn()
 - strstr()
 - strtok()
 - strtolower()
 - strtoupper()
 - strtr()
 - str_getcsv()
 - str_ireplace()
 - str_pad()
 - str_repeat()
 - str_replace()
 - str_rot13()
 - str_shuffle()
 - str_split()
 - str_word_count()
 - substr()
 - substr_compare()
 - substr_count()
 - substr_replace()
 - trim()
 - ucfirst()
 - ucwords()
 - vfprintf()
 - vprintf()
 - vsprintf()
 - wordwrap()
 
 - 
                        Array
- array()
 - array_change_key_case()
 - array_chunk()
 - array_column()
 - array_combine()
 - array_count_values()
 - array_diff()
 - array_diff_assoc()
 - array_diff_key()
 - array_diff_uassoc()
 - array_diff_ukey()
 - array_fill()
 - array_fill_keys()
 - array_filter()
 - array_flip()
 - array_intersect()
 - array_intersect_assoc()
 - array_intersect_key()
 - array_intersect_uassoc()
 - array_intersect_ukey()
 - array_keys()
 - array_key_exists()
 - array_key_first()
 - array_key_last()
 - array_map()
 - array_merge()
 - array_merge_recursive()
 - array_multisort()
 - array_pad()
 - array_pop()
 - array_product()
 - array_push()
 - array_rand()
 - array_reduce()
 - array_replace()
 - array_replace_recursive()
 - array_reverse()
 - array_search()
 - array_shift()
 - array_slice()
 - array_splice()
 - array_sum()
 - array_udiff()
 - array_udiff_assoc()
 - array_udiff_uassoc()
 - array_uintersect()
 - array_uintersect_assoc()
 - array_uintersect_uassoc()
 - array_unique()
 - array_unshift()
 - array_values()
 - array_walk()
 - array_walk_recursive()
 - arsort()
 - asort()
 - compact()
 - count()
 - current()
 - each()
 - end()
 - extract()
 - in_array()
 - key()
 - key_exists()
 - krsort()
 - ksort()
 - list()
 - natcasesort()
 - natsort()
 - next()
 - pos()
 - prev()
 - range()
 - reset()
 - rsort()
 - shuffle()
 - sizeof()
 - sort()
 - uasort()
 - uksort()
 - usort()
 
 - 
                        File
- basename()
 - chgrp()
 - chmod()
 - chown()
 - clearstatcache()
 - copy()
 - dirname()
 - diskfreespace()
 - disk_free_space()
 - disk_total_space()
 - fclose()
 - feof()
 - fflush()
 - fgetc()
 - fgetcsv()
 - fgets()
 - fgetss()
 - file()
 - fileatime()
 - filectime()
 - filegroup()
 - fileinode()
 - filemtime()
 - fileowner()
 - fileperms()
 - filesize()
 - filetype()
 - file_exists()
 - file_get_contents()
 - file_put_contents()
 - flock()
 - fnmatch()
 - fopen()
 - fpassthru()
 - fputcsv()
 - fputs()
 - fread()
 - fscanf()
 - fseek()
 - fstat()
 - ftell()
 - ftruncate()
 - fwrite()
 - glob()
 - is_dir()
 - is_executable()
 - is_file()
 - is_link()
 - is_readable()
 - is_uploaded_file()
 - is_writable()
 - is_writeable()
 - lchgrp()
 - lchown()
 - link()
 - linkinfo()
 - lstat()
 - mkdir()
 - move_uploaded_file()
 - parse_ini_file()
 - parse_ini_string()
 - pathinfo()
 - pclose()
 - popen()
 - readfile()
 - readlink()
 - realpath()
 - realpath_cache_get()
 - realpath_cache_size()
 - rename()
 - rewind()
 - rmdir()
 - set_file_buffer()
 - stat()
 - symlink()
 - tempnam()
 - tmpfile()
 - touch()
 - umask()
 - unlink()
 
 - 
                        Datetime
- checkdate()
 - date()
 - date_add()
 - date_create()
 - date_create_from_format()
 - date_date_set()
 - date_default_timezone_get()
 - date_default_timezone_set()
 - date_diff()
 - date_format()
 - date_get_last_errors()
 - date_interval_create_from_date
 - date_interval_format()
 - date_isodate_set()
 - date_modify()
 - date_offset_get()
 - date_parse()
 - date_parse_from_format()
 - date_sub()
 - date_sunrise()
 - date_sunset()
 - date_sun_info()
 - date_timestamp_get()
 - date_timestamp_set()
 - date_timezone_get()
 - date_timezone_set()
 - date_time_set()
 - getdate()
 - gettimeofday()
 - gmdate()
 - gmmktime()
 - gmstrftime()
 - idate()
 - localtime()
 - microtime()
 - mktime()
 - strftime()
 - strptime()
 - strtotime()
 - time()
 - timezone_abbreviations_list()
 - timezone_identifiers_list()
 - timezone_location_get()
 - timezone_name_from_abbr()
 - timezone_name_get()
 - timezone_offset_get()
 - timezone_open()
 - timezone_transitions_get()
 - timezone_version_get()
 
 - 
                        Filter
 - 
                        HTTP
 - 
                        cURL
- curl_close()
 - curl_copy_handle()
 - curl_errno()
 - curl_error()
 - curl_escape()
 - curl_exec()
 - curl_file_create()
 - curl_getinfo()
 - curl_init()
 - curl_multi_add_handle()
 - curl_multi_close()
 - curl_multi_errno()
 - curl_multi_exec()
 - curl_multi_getcontent()
 - curl_multi_info_read()
 - curl_multi_init()
 - curl_multi_remove_handle()
 - curl_multi_select()
 - curl_multi_setopt()
 - curl_multi_strerror()
 - curl_pause()
 - curl_reset()
 - curl_setopt()
 - curl_setopt_array()
 - curl_share_close()
 - curl_share_errno()
 - curl_share_init()
 - curl_share_setopt()
 - curl_share_strerror()
 - curl_strerror()
 - curl_unescape()
 - curl_version()
 
 - 
                        PDO
 - 
                        PDOStatement
 
sscanf()
1. 定义
该函数根据指定格式解析字符串。
2. 语法
sscanf ( string $str , string $format [, mixed &$... ] ) : mixed
3. 参数说明
| 参数 | 可选性 | 数据类型 | 描述 | 
|---|---|---|---|
| $str | 必需 | 字符串 | 要被解析的字符串 | 
| $format | 必需 | 数组 | 解析格式,例如%s\t%d | 
| ... | 可选 | mixed | 被设置为解析匹配的值 | 
其中$format的格式为%[flags][width][.precision]specifier
flags的值有五种:
-:表示输出时为左对齐,默认为右对齐+:用加号+前缀正数;默认仅为负数,前缀为负号空格:默认用空格填充结果(位数)0:左边的数字使用0填充,如果是字符串也可以用0填充右边的内容':使用单引号包裹的字符,可以被用来填充结果
width表示允许最长输出的位数。
precision根据标识符的不同含义也不同:
- 对于
e、E标识符来说,该值表示小数点后保留的位数 - 对于
s标识符来说,该值表示允许被输出的最大字符数 
specifier标识符 | 
说明 | 
|---|---|
| % | 字面量百分号 | 
| c | ASCII码字符 | 
| d | 带符号(正负号)的十进制整数 | 
| D | 十进制整数 | 
| e | 科学计数法数 | 
| E | 使用大写字母E表示的科学计数法 | 
| o | 十进制整数 | 
| s | 遇到任意空格字符时停止读取 | 
| u | 无符号十进制整数 | 
| x | 小写形式的十六进制整数 | 
| X | 大写形式的十六进制整数 | 
| n | 目前已处理的字符数 | 
另外,如果只传入了前两个参数,该函数将返回一个数组;如果传入可选参数,将返回被设置了值的个数。
如果$format中要求的子字符串多于$str可用的,将返回-1。
4. 示例
<?php
// sscanf()
// 根据指定格式解析字符串
$str = "网站名称:极速教程\t网站地址:https://www.jisuapi.com/\t联系方式:18888888888";
$format = '%s';// 解析到 空格符(包括换行符和Tab空格)便停止
$res = sscanf($str, $format);
var_dump($res);
/* 输出:
array(1) {
  [0]=>
  string(27) "网站名称:极速教程"
}
*/
$format = '%s%n';// 解析到 空格符(包括换行符和Tab空格)便停止,并返回已解析的字符串长度
$res = sscanf($str, $format);
var_dump($res);
/* 输出:
array(2) {
  [0]=>
  string(27) "网站名称:极速教程"
  [1]=>
  int(27)
}
*/
$format = "%s\t%s\t%s";
$res = sscanf($str, $format, $name, $host, $phone);// 从第三个参数起,依次对应$format中的子字符串结果
var_dump($res);// 输出:int(3)
echo $name, "\t", $host, "\t", $phone;// 输出:网站名称:极速教程      网站地址:https://www.jisuapi.com/      联系方式:18888888888
5. 延展阅读