当前位置: 首页 > news >正文

做写字楼的网站有哪些职业技术培训

做写字楼的网站有哪些,职业技术培训,做图软件官方网站,pc官方网站一 fgets(resource $stream, ?int $length null) 从文件指针中读取一行。 返回字符串,如果文件指针中没有更多的数据了则返回 false。错误发生时返回 false。 $stream 为文件资源,必须指向fopen()或fscokopen()成功打开的文件。文件打开之后&#x…

一 fgets(resource $stream, ?int $length = null)

从文件指针中读取一行。

返回字符串,如果文件指针中没有更多的数据了则返回 false。错误发生时返回 false

$stream 为文件资源,必须指向fopen()或fscokopen()成功打开的文件。文件打开之后,必须使用fclose()关闭

#test.htm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
……
$file = "test.htm";
$file_obj = fopen($file, "r");
$str = fgets($file_obj, 10);
var_dump($str);#测试结果
string(9) "<!DOCTYPE"

二 fgetss(resource $handle, int $length = ?, string $allowable_tags = ?)

和fgets()相同,但是过滤HTML和PHP标签。返回字符串,错误返回false,文件无内容返回false。

$handle 文件指针

$length 获取字符串长度

$allowable_tags 指定不被去除的标签

自php 7.3.0版本启用,自php 8.0.0起移除。

三 strip_tags(string $string, array|string|null $allowed_tags = null)

从字符串中去除 HTML 和 PHP 标签,机制与fgetss()相同。

参数说明惨开fgetss()。

    $file = "test.htm";$total_lines = 10;$file_obj = fopen($file, "r");$str = "";while (($buffer = fgets($file_obj, 2048)) != false) {$str .= $buffer;if ($total_lines <= 0) {break;}$total_lines--;}var_dump($str);$str = strip_tags($str, "<link>");var_dump($str);

测试结果

string(492) "<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>PHP: fgets - Manual </title><link rel="icon" type="image/svg+xml" sizes="any" href="https://www.php.net/favicon.svg?v=2"><link rel="icon" type="image/png" sizes="196x196" href="https://www.php.net/favicon-196x196.png?v=2">
"
string(244) "PHP: fgets - Manual<link rel="icon" type="image/svg+xml" sizes="any" href="https://www.php.net/favicon.svg?v=2"><link rel="icon" type="image/png" sizes="196x196" href="https://www.php.net/favicon-196x196.png?v=2">
"

四 mb_convert_case(string $string, int $mode, ?string $encoding = null)

对字符串进行大小写转换。大小转换执行根据Unicode字母属性的基础,而strtolower()和strtoupper()使用标准大小写转换。因此函数的行为不受语言环境(locale)设置的影响,能够转换任意具有“字母”属性的字符,例如元音变音A(Ä)。

$mod 可用模式包括:MB_CASE_UPPERMB_CASE_LOWERMB_CASE_TITLEMB_CASE_FOLDMB_CASE_UPPER_SIMPLEMB_CASE_LOWER_SIMPLEMB_CASE_TITLE_SIMPLEMB_CASE_FOLD_SIMPLE。

MB_CASE_UPPER、MB_CASE_UPPER_SIMPLE 全部转大写

MB_CASE_LOWER、MB_CASE_LOWER_SIMPLE 全部转小写

MB_CASE_TITLE、MB_CASE_TITLE_SIMPLE 转为首字母大写

MB_CASE_FOLD、MB_CASE_FOLD_SIMPLE 看起来像全部转小写

$encoding 字体编码

    $str = "qWe asD zxc 123q";var_dump($str);$str = mb_convert_case($str, MB_CASE_UPPER, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_LOWER, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_TITLE, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_FOLD, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_UPPER_SIMPLE, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_LOWER_SIMPLE, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_TITLE_SIMPLE, "GBK");var_dump($str);$str = mb_convert_case($str, MB_CASE_FOLD_SIMPLE, "GBK");var_dump($str);

测试结果

string(16) "qWe asD zxc 123q"
string(16) "QWE ASD ZXC 123Q"
string(16) "qwe asd zxc 123q"
string(16) "Qwe Asd Zxc 123Q"
string(16) "qwe asd zxc 123q"
string(16) "QWE ASD ZXC 123Q"
string(16) "qwe asd zxc 123q"
string(16) "Qwe Asd Zxc 123Q"
string(16) "qwe asd zxc 123q"

五 array_map(?callable $callback, array $array, array ...$arrays)

为数组的每个元素应用回调函数。返回数组,包括callback结果。callback参数与对应处理的数组数量相同,传入多个数组时,返回的数组键是按顺序的 integer。

function dealwitcharr($value1, $value2) {if (is_numeric($value1) && is_numeric($value2)) {return $value1 + $value2;}return $value1 . "&" . $value2;
}    
$arr1 = ['test1', '1', '3', 'test2'];
$arr2 = ['5', '6', 'test1', 'test2'];
$arr = array_map("dealwitcharr", $arr1, $arr2);
var_dump($arr);

 测试结果

array(4) {[0]=>string(7) "test1&5"[1]=>int(7)[2]=>string(7) "3&test1"[3]=>string(11) "test2&test2"
}

六 get_defined_vars()

返回由所有已定义变量所组成的数组。

    $test1 = "123";// ob_end_clean();$arr = get_defined_vars();var_dump($arr);

测试结果

array(1) {       ["test1"]=>    string(3) "123"
}

七 get_debug_type(mixed $value)

该函数会将对象解析为其类名。该函数与 gettype() 的区别在于:它返回的类型名称更符合实际用法,而不是那些出于历史原因而存在的名称。

    echo get_debug_type(null) . PHP_EOL;echo get_debug_type(true) . PHP_EOL;echo get_debug_type(1) . PHP_EOL;echo get_debug_type(0.1) . PHP_EOL;echo get_debug_type("foo") . PHP_EOL;echo get_debug_type([]) . PHP_EOL;echo get_debug_type(new stdClass) . PHP_EOL;echo get_debug_type(new class {}) . PHP_EOL;

测试结果

null
bool
int
float
string
array
stdClass
class@anonymous

八 http_build_query

生成 URL-encode 之后的请求字符串。

参数列表:

  1. data 请求数据,数组或对象。为对象,仅public属性会加入结果。
  2. numeric_perfix 基础数组中的数字下标元素的前缀。PHP 或其它 CGI 程序在稍后对数据进行解码时获取合法的变量名。
  3. arg_separator 参数分隔符。如果未设置或为null。
  4. encoding_type 编码类型,默认PHP_QUERY_RFC1738。PHP_QUERY_RFC1738将根据REC3986编码和application/x-www-form-urlencoded 媒体类型进行编码,空格会被编码成加号(+)。PHP_QUERY_RFC3986将根据RFC3986编码,空格会被百分号编码(%20)。
    $user = new User("张三", 20);$data = $user;$str = http_build_query($data, 'user', "&", PHP_QUERY_RFC1738);var_dump($str);$str = http_build_query($data, 'user', "|", PHP_QUERY_RFC3986);var_dump($str);

 测试结果

string(30) "name=%E5%BC%A0%E4%B8%89&age=20"
string(30) "name=%E5%BC%A0%E4%B8%89|age=20"

九 array_replace_recursive(array $array, array ...$replacements)

使用传递的数组递归替换第一个数组的元素。后面的数组替换第一个数组,若不存在则在一个数组中创建,若参数中有多于一维的数组会递归遍历。

     $arr1 = [1, 2, "qwe", 4, "asd", ['a', 'b', 'c']];$arr2 = [1, 2, "qwe1", 5, "asd", ['a1', 'b', 'c'], 8];$arr3 = [1, 2, 3, 5, 6, 7];$str = array_replace_recursive($arr1, $arr2, $arr3);var_dump($str);$str = array_replace_recursive($arr1, $arr2);var_dump($str);

测试结果

array(7) {[0]=>   int(1)[1]=>int(2)[2]=>int(3)[3]=>int(5)[4]=>int(6)[5]=>int(7)[6]=>int(8)
}
array(7) {[0]=>int(1)[1]=>int(2)[2]=>string(4) "qwe1"[3]=>int(5)[4]=>string(3) "asd"[5]=>array(3) {[0]=>string(2) "a1"[1]=>string(1) "b"[2]=>string(1) "c"}[6]=>int(8)
}

十 array_unique(array $array, int $flags = SORT_STRING)

移除数组中重复的值。

$flags 用于比较行为,可用值如下:

  1. SORT_REGULAR 按照通常方法比较,不改变数据类型
  2. SORT_NUMERIC 按照数字形式比较,仅比较值
  3. SORT_STRING 按照字符串形式比较 默认,仅比较值
  4. SORT_LOCALE_STRING 根据当前的本地化设置,按照字符串比较
    $arr = ["green", "green1", "green3", "1green", "9a", "2blue", "red"];foreach ($arr as $key => $value) {echo $value . "=>" . (int) $value . PHP_EOL;}$result = array_unique($arr, SORT_NUMERIC);var_dump($result);

测试结果

green=>0
green1=>0
green3=>0
1green=>1
9a=>9
2blue=>2
red=>0
array(4) {[0]=>string(5) "green"[3]=>string(6) "1green"[4]=>string(2) "9a"[5]=>string(5) "2blue"
}

SORT_NUMERIC将值全部转为数字,所以green、green1、green3、red都是0,且仅使用第一个green,所以测试结果中green1、green3、red都未显示。


文章转载自:
http://scoresheet.jtrb.cn
http://bailment.jtrb.cn
http://pupiparous.jtrb.cn
http://hydroformer.jtrb.cn
http://cardioversion.jtrb.cn
http://cosmic.jtrb.cn
http://asserted.jtrb.cn
http://subtorrid.jtrb.cn
http://multangular.jtrb.cn
http://sacrilegious.jtrb.cn
http://sphagna.jtrb.cn
http://sabaoth.jtrb.cn
http://diuretic.jtrb.cn
http://wisha.jtrb.cn
http://disposure.jtrb.cn
http://triiodomethane.jtrb.cn
http://misorient.jtrb.cn
http://taximeter.jtrb.cn
http://phototroph.jtrb.cn
http://companionway.jtrb.cn
http://semanteme.jtrb.cn
http://nondefense.jtrb.cn
http://crankpin.jtrb.cn
http://myasthenia.jtrb.cn
http://collaborateur.jtrb.cn
http://delicatessen.jtrb.cn
http://photostat.jtrb.cn
http://repellent.jtrb.cn
http://vernalization.jtrb.cn
http://anonymuncule.jtrb.cn
http://demulsification.jtrb.cn
http://haemocytometer.jtrb.cn
http://engrail.jtrb.cn
http://dumbhead.jtrb.cn
http://renegotiate.jtrb.cn
http://meditatively.jtrb.cn
http://cylindromatous.jtrb.cn
http://taxameter.jtrb.cn
http://curbing.jtrb.cn
http://camphol.jtrb.cn
http://outskirt.jtrb.cn
http://hydra.jtrb.cn
http://chemosphere.jtrb.cn
http://goniometric.jtrb.cn
http://houri.jtrb.cn
http://conidia.jtrb.cn
http://boodler.jtrb.cn
http://jl.jtrb.cn
http://euonymus.jtrb.cn
http://odd.jtrb.cn
http://separate.jtrb.cn
http://dayside.jtrb.cn
http://spank.jtrb.cn
http://drillable.jtrb.cn
http://rapier.jtrb.cn
http://rootle.jtrb.cn
http://oniongrass.jtrb.cn
http://tangerine.jtrb.cn
http://hibernaculum.jtrb.cn
http://noology.jtrb.cn
http://screwball.jtrb.cn
http://keeve.jtrb.cn
http://luxury.jtrb.cn
http://filbert.jtrb.cn
http://needlestone.jtrb.cn
http://staphylorrhaphy.jtrb.cn
http://disraelian.jtrb.cn
http://helping.jtrb.cn
http://sherwani.jtrb.cn
http://appreciator.jtrb.cn
http://cmyk.jtrb.cn
http://desirable.jtrb.cn
http://cerebroid.jtrb.cn
http://euglena.jtrb.cn
http://shinplaster.jtrb.cn
http://microsection.jtrb.cn
http://dietetics.jtrb.cn
http://dominator.jtrb.cn
http://cowhage.jtrb.cn
http://unfrequent.jtrb.cn
http://itinerancy.jtrb.cn
http://adh.jtrb.cn
http://rockslide.jtrb.cn
http://stagnantly.jtrb.cn
http://inequality.jtrb.cn
http://hidalgo.jtrb.cn
http://interseptal.jtrb.cn
http://possession.jtrb.cn
http://azote.jtrb.cn
http://predicative.jtrb.cn
http://fess.jtrb.cn
http://reemploy.jtrb.cn
http://gasification.jtrb.cn
http://cabana.jtrb.cn
http://somasteroid.jtrb.cn
http://resegregate.jtrb.cn
http://albata.jtrb.cn
http://thalamencephalon.jtrb.cn
http://rosefish.jtrb.cn
http://aslope.jtrb.cn
http://www.15wanjia.com/news/80525.html

相关文章:

  • 我是做装修的怎么样投资网站广告策划书
  • 张店网站优化推广厦门关键词优化企业
  • 没有域名可以建网站吗免费开通网站
  • 有什么网站是学做吃的今日实时热点新闻事件
  • 电商网站设计公司有哪些淘宝指数官网
  • 小程序 微网站小白如何学电商运营
  • 网站 错误代码网络营销的营销方式
  • 做网站公司郑州郑州的网站建设公司天津seo排名公司
  • 在线网站优化公司seo代码优化
  • 浙江省建设信息网seo修改器
  • 最大的b2c平台全网优化推广
  • 做电影网站有什么好处和坏处app开发工具
  • 网站建设需要的条件企业营销策划方案
  • 做博客网站赚钱营销网站都有哪些
  • 山东网站建设app前端培训哪个机构靠谱
  • 建e网app下载网络优化工程师证书
  • 微信小程序制作费用是多少宁波seo企业推广
  • 南昌做网站哪个公司好湖南网络推广排名
  • 网络建站免费网址百度提交网址
  • 做设计的分析图网站有哪些个人网站搭建
  • sns网站设计网络推广平台哪家公司最好
  • 网站在线做照片网店推广
  • 做会议活动的网站站长seo推广
  • 郑州网站制作公司名单友情链接平台哪个好
  • 房城乡建设委房管局官方网站seo咨询茂名
  • 济南网站建设公司电子商务网站惠州seo代理
  • 专做衬衣的网站营销策划公司简介
  • 做线下极限运动的网站全球网站流量查询
  • 网站h1标签怎么做软文代写公司
  • 电销如何介绍网站建设淘宝运营培训课程