


Thinkphp6 custom configuration file and call (configuration under the config folder)
The following tutorial column of thinkphp will introduce to you the Thinkphp6 custom configuration file and the method of calling (configuration under the config folder). I hope it will be useful to friends who need it. help!
1. Create a new test.php configuration file under thinkphp\config\
2.test.php
<?php // 自定义配置文件 return [ 'profile' => [ 'name' => 'mmcike', 'bank' => [ 'ABC' => '123', 'ncaa' ] ] ];
3. Call the test.php configuration file
// 1.调用整个数组 $testConfig = \think\facade\Config::get('test'); //注意 //test.php 就是配置文件名称
Output:
// 2.只调用键名 profile 下的数组 $profile = \think\facade\Config::get('test.profile');
输出:
// 3.调用索引键的数组 $val = \think\facade\Config::get('test.profile.bank.0');
输出:
The above contains the calling forms of most arrays.
Related recommendations: The latest 10 thinkphp video tutorials
The above is the detailed content of Thinkphp6 custom configuration file and call (configuration under the config folder). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

