PHP configures its own configuration file

WBOY
Release: 2016-08-08 09:20:27
Original
1003 people have browsed it

Example:

The first step is to create an order.php file in the application/config/ directory.

Add the following code:

<?php
	$config['order'] = array(
		'os_type' => array(
	        "0"=>"Android 客户端",
	        "1"=>"iOS 客户端",
	        "3"=>"微信公共帐号",
	        "4"=>"360",
	        "5"=>"网页版",
	        "6"=>"神马搜索",
	        "10"=>"大众点评",
	        "11"=>"美团"
	    ),
    	'pay_type' => array(
	        1 => '微信',
	        2 => '支付宝',
	        3 => '微信公众',
	        4 => '免费',
	        5 => '只使用套餐卡'
	    )
   	);
?>
Copy after login

Step 2: Get the configuration file

       $this->config->load('order',TRUE);
       $order_config = $this->config->item('order', 'order');
       $os_type = $order_config['os_type'];
       $pay_type_list = $order_config['pay_type'];
Copy after login

The above introduces how to configure PHP to configure its own configuration file, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!