This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
/** PBKDF2 Implementation (as described in RFC 2898); | |
* | |
* @param string p password | |
* @param string s salt | |
* @param int c iteration count (use 1000 or higher) | |
* @param int kl derived key length | |
* @param string a hash algorithm | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//IUser 接口定义用户对象应执行什么操作。IUser 的实现称为 User | |
interface IUser | |
{ | |
function getName(); | |
} | |
class User implements IUser | |
{ | |
public function __construct( $id ) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//返回调用该方法的类名 | |
class Father{ | |
public function demo1(){ | |
return get_called_class(); | |
} | |
public static function demo2(){ | |
return get_called_class(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//创建父类:Father | |
//方法返回定义该方法的类名 | |
class Father{ | |
public function demo1(){ | |
return get_class(); | |
} | |
public static function demo2(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\index\controller; | |
//导入模型类 | |
use app\index\model\Staff; | |
class Index { | |
public function index(){ | |
//模型静态调用【数据库查询方法】 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\index\controller; | |
use app\index\model\Staff; | |
class Index { | |
public function index(){ | |
//1.执行查询,返回数据对象数组 | |
$result = Staff::all('1009,1010'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\index\controller; | |
use app\index\model\Staff; | |
class Index { | |
public function index(){ | |
/* | |
1.创建$data数组 | |
$data['id'] = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//array parse_ini_file ( string $filename [, bool $process_sections = false [, int $scanner_mode = INI_SCANNER_NORMAL ]] ) | |
// Parse without sections | |
$ini_array = parse_ini_file("sample.ini"); | |
print_r($ini_array); | |
// Parse with sections | |
$ini_array = parse_ini_file("sample.ini", true); | |
print_r($ini_array); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; This is a sample configuration file | |
; Comments start with ';', as in php.ini | |
[first_section] | |
one = 1 | |
five = 5 | |
animal = BIRD | |
[second_section] | |
path = "/usr/local/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 根据主管获取业务员所在团队区域 | |
* @param string $chief 主管 | |
* @return string 区域 | |
*/ | |
public function getTeamByChief($chief) | |
{ | |
$where = [ | |
"user"=>$chief, |
NewerOlder