Category: php

CentOS7 yum install PHP7.2 0

CentOS7 yum install PHP7.2

Hits: 0installation steps If PHP is already installed, execute the following command to uninstall yum -y remove php* Since php7.x does not exist in the yum source of linux, we need to change the...

Validator’s form validation in laravel 0

Validator’s form validation in laravel

Hits: 0========================== $validator = Validator::make($request->all(), [ ‘nickname’ => ‘required|max:8|string’, ‘signature’ => ‘string|max:30’, ‘gender’ => ‘ integer’, ‘height’ => ‘ digits_between:50,300’, ‘weight’ => ‘ integer|min:2|max:3’, ‘birth_date’ => ‘date’, ‘city’ => ‘string’, ‘order_number’ => ‘exists:orders,order_number’, ‘openid’...

Understanding of PHP stack data segment code segment 0

Understanding of PHP stack data segment code segment

Hits: 0Understanding of PHP stack data segment code segment Stack: basic data type (roughly understood as space A, where the number 8 is stored) Heap: object created by new Code segment: function, running code...

txt file into mysql 0

txt file into mysql

Hits: 0LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' [REPLACE | IGNORE] INTO TABLE tbl_name [CHARACTER SET charset_name] [{FIELDS | COLUMNS} [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] ] [LINES [STARTING...

The method of modifying the enumeration type enum in the laravel framework 0

The method of modifying the enumeration type enum in the laravel framework

Hits: 0public function up () { // Just add this sentence Schema::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping( 'enum' , 'string' ); Schema::table('contract_records', function (Blueprint $table) { $table->string('level')->change(); }); } [Schema]::getConnection()->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping(‘enum’, ‘string’); public function up () { // Just add...

PHP closure function and closure function callback 0

PHP closure function and closure function callback

Hits: 0PHP [closure] function and closure function callback A function without a name becomes an anonymous function eg: $sum = function($num1,$num2){ return $num1+$num2; }; //Anonymous function call echo $sum( 1 , 2 ); [Callback]...

PHP – Laravel view template (blade.php) loop convenience 0

PHP – Laravel view template (blade.php) loop convenience

Hits: 0 web.phproute parameter Route::get( ‘req’ , function () { // Json parameter $users = [ [‘id’=>1, ‘name’=>’test’], [‘id’=>2, ‘name’=>’dzm’], [‘id’=>3, ‘name’=>’xyq’] ]; return view(‘index’)->with([‘users’=>$users]); }); Commonly used loops for (blade.php)view templates are:for 1、@foreach...

PHP – Laravel Ternary Operations 0

PHP – Laravel Ternary Operations

Hits: 0<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta > <title>Document</title> </head> <body> <!– The following methods are equivalent to <?php echo isset($name) ? $name : 'default' ?> –> <!– Most...