PHP判断在数组中排第几

<?php $grades = array(85, 90, 73, 79, 92, 88, 75); $rank = array_search(79, $grades); echo "您的成绩在数组中的排名是第 $rank 名。"; ?>
刚子 发布于 

PHP解析JSON数据

<?php $jsonString = '{"errcode":0,"errmsg":"ok"}'; // 将JSON字符串转换为PHP对象 $dataObject = json_decode($jsonString); // 将JSON字符串转换为PHP关联数组 $dataArray = json_decode($jsonString, tr...
刚子 发布于 

PHP解析XML

输出 XML 字符串中每个子节点的元素名称和数据: <?php $note=<<<XML <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Do...
刚子 发布于 

PHP读取XML数据

解析XML字符串: $xmlString = '<root><element>Value</element></root>'; $xmlObject = simplexml_load_string($xmlString); echo $xmlObject->element; // 输出 Value 解析X...
刚子 发布于 

禁止微信h5长按识别图片二维码放大图片

添加属性:draggable="false" 禁止拖拽
刚子 发布于 

Win10提示无法使用内置管理员账户打开Edge如何解决?

 内置管理员无法打开microsoft edge?   这个问题的原因在于Windows应用开启默认需要用户账户控制UAC支持,而Win10管理员账户不开启UAC。因此在Administrator账户下默认不能运行Windows应用。   不过只要略微修改以下注册表,就可以突破默认的封锁,在管理员账户中正常运行Windows应用。但需要提醒各位,修改注册表操...
刚子 发布于 

PHP SQL删除字段换行符

fa_video为表名,file是字段。 UPDATE fa_video SET file = REPLACE(file, CHAR(10), ''), file = REPLACE(file, CHAR(13), '');
刚子 发布于 

PHP unicode转中文

function unicodeDecode($unicode_str){ $json = '{"str":"'.$unicode_str.'"}'; $arr = json_decode($json,true); if(empty($arr)) return ''; return $arr['str']; }
刚子 发布于 

小程序获取页面参数值

比如路径为 xxx.html?id=11 function getCurrentPagePath() { const pages = getCurrentPages(); // 获取加载的页面 const currentPage = pages[pages.length - 1]; // 获取当前页面的对象 const currentPage2 ...
刚子 发布于 

emlog伪静态规则之nginx

location / { index index.php index.html; if (!-e $request_filename) { rewrite ^/(.+)$ /index.php last; } }
刚子 发布于