1. 安装phpcd /usr/ports/lang/php5make config 这里记得选上fast-cgimake install clean
完成后,记得拷贝php的配置文件:cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
安装扩展cd /usr/ports/lang/php5-extensions/make install clean
2. 安装nginxcd /usr/ports/www/nginxma...
function delhtml($content){ $content = eregi_replace("<html>.+</head>","", $content); $content = preg_replace("/<.+?>/i","", $content); return $content; } $oneurl = "http://www.chenapp.com"; $content = file_get_contents($oneurl); echo delhtml($content);
在运行时必须知道某个变量为何值。
然后在php.ini中设置:include_path = "c:/php",并将debug.php放在此文件夹,以后就可以在每个网页里包含此文件,查看得到的变量名和值.
从网上看看了一些php下载文件的资料,改了改,写了这么个函数.
安装Nginx和php
sudo apt-get update #更新源
sudo apt-get install php7.3 php7.3-fpm php7.3-mysql php7.3-common
sudo apt-get install nginx
sudo service nginx start #重启nginx
sudo service php7.3-fpm restart #重启php
匹配中文字符的正则表达式: [u4e00-u9fa5]
匹配双字节字符(包括汉字在内): [^x00-xff]
应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)
冒泡排序(数组排序)