01. 数组辅助函数,可以方便的查看数组内部的成员,用法如下图所示:
<?php namespace App\Controllers; class Hello extends BaseController { //http://127.0.0.1/CI4/public/ //http://127.0.0.1/CI4/public/index.php/hello //http://127.0.0.1/CI4/public/index.php/hello/hello protected $helpers = [‘array‘, ‘App\Helpers\Tx‘]; function __construct() { } public function hello() { $data = [ ‘班级‘ => [ ‘一班‘ => [ ‘姓名‘ => ‘张三‘ ], ‘二班‘ => [ ‘姓名‘ => ‘李四‘ ] ] ]; $rst = dot_array_search(‘*.*.姓名‘, $data); ShowMessage($rst); } public function index() { echo ‘青青子衿悠悠我心‘; } //-------------------------------------------------------------------- }
02.我们打开浏览器查看内容
知识有价,如果您认为这篇文章有价值,认同作者的付出,可以微信二维码打赏任意金额给作者(微信号:382477247)哦,谢谢。
原文地址:https://www.cnblogs.com/tianpan2019/p/12228736.html
时间: 2024-11-11 23:06:38