- 浏览: 2539194 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
PHP Backend Application(1)Env and PHP Knowledge
Check the PHP version
> php --version
PHP 5.6.16 (cli) (built: Dec 26 2015 18:37:18)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
The comments style is similar to Java, file starter and end are like this
<?php
echo "php runs first!";
echo "\nrecall my php knowledge"; // one line comments
/*
this is how th comments go in java
*/
?>
Types
Four scalar type: boolean, integer, float, string
Two compound types: array, object
Two special types: resource, NULL
Check the type and get type
<?php
$a_boolean = TRUE;
$a_string = "foo";
echo gettype($a_boolean);
echo "\n";
echo var_dump($a_string);
echo is_string($a_string);
echo "\n";
?>
console output is as follow:
boolean
string(3) "foo"
1
Cast other value to boolean
var_dump((bool) 1); // bool(true)
var_dump((bool) -2); // bool(true)
Automatically covert the int to float
$large_number = 2147483647;
var_dump($large_number); // int(2147483647)
$large_number = 2147483648;
var_dump($large_number); // float(2147483648)
Single Quoted for String
// Outputs: This will not expand: \n a newline
echo 'This will not expand: \n a newline';
// Outputs: Variables do not $expand $either
echo 'Variables do not $expand $either';
Double Quoted
Heredoc
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
nowdoc is single quoted heredoc
echo <<<'EOT'
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': \x41
EOT;
Environment and Types
> cat type.php
<?php
$arr = array("foo"=>1, 12=>true);
echo gettype($arr[12])."\n";
echo $arr[12]."\n";
?>
> php type.php
boolean
1
unset($arr[5]); // This removes the element from the array
unset($arr); // This deletes the whole array
As mentioned above, if no key is specified, the maximum of the existing integer indices is taken, and the new key will be that maximum value plus 1.
A lot of useful array operations are here http://sillycat.iteye.com/blog/1543227
The unset() function allows removing keys from an array. Be aware that the array will not be reindexed.
The array_values() function can be used to 'remove and shift'.
$a = array(1 => 'one', 2 => 'two', 3 => 'three');
unset($a[2]);
/* will produce an array that would have been defined as
$a = array(1 => 'one', 3 => 'three');
and NOT
$a = array(1 => 'one', 2 =>'three');
*/
print_r($a);
echo "<br />";
$b = array_values($a);
// Now $b is array(0 => 'one', 1 =>'three')
print_r($b);
http://sillycat.iteye.com/blog/2302285
Code Standard
http://sillycat.iteye.com/blog/2194084
PHP with FPM
http://sillycat.iteye.com/blog/2223621
PHP Lumen
http://sillycat.iteye.com/blog/2238841
http://sillycat.iteye.com/blog/2239826
Install latest PHP on EC2
http://sillycat.iteye.com/blog/2302287
UNIT Test
http://sillycat.iteye.com/blog/2302288
> phpunit --version
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.
References:
PHP Basic1 ~ 3
http://sillycat.iteye.com/blog/768664
http://sillycat.iteye.com/blog/769110
http://sillycat.iteye.com/blog/770369
PHP 1~ 8
http://sillycat.iteye.com/blog/1543227
http://sillycat.iteye.com/blog/2066063
http://sillycat.iteye.com/blog/2302285
http://sillycat.iteye.com/blog/2194084
http://sillycat.iteye.com/blog/2223621
http://sillycat.iteye.com/blog/2238841
http://sillycat.iteye.com/blog/2239826
Language References
http://php.net/manual/en/langref.php
PHP Env
http://sillycat.iteye.com/blog/1634562
http://sillycat.iteye.com/blog/1638638
Check the PHP version
> php --version
PHP 5.6.16 (cli) (built: Dec 26 2015 18:37:18)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
The comments style is similar to Java, file starter and end are like this
<?php
echo "php runs first!";
echo "\nrecall my php knowledge"; // one line comments
/*
this is how th comments go in java
*/
?>
Types
Four scalar type: boolean, integer, float, string
Two compound types: array, object
Two special types: resource, NULL
Check the type and get type
<?php
$a_boolean = TRUE;
$a_string = "foo";
echo gettype($a_boolean);
echo "\n";
echo var_dump($a_string);
echo is_string($a_string);
echo "\n";
?>
console output is as follow:
boolean
string(3) "foo"
1
Cast other value to boolean
var_dump((bool) 1); // bool(true)
var_dump((bool) -2); // bool(true)
Automatically covert the int to float
$large_number = 2147483647;
var_dump($large_number); // int(2147483647)
$large_number = 2147483648;
var_dump($large_number); // float(2147483648)
Single Quoted for String
// Outputs: This will not expand: \n a newline
echo 'This will not expand: \n a newline';
// Outputs: Variables do not $expand $either
echo 'Variables do not $expand $either';
Double Quoted
Heredoc
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
nowdoc is single quoted heredoc
echo <<<'EOT'
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': \x41
EOT;
Environment and Types
> cat type.php
<?php
$arr = array("foo"=>1, 12=>true);
echo gettype($arr[12])."\n";
echo $arr[12]."\n";
?>
> php type.php
boolean
1
unset($arr[5]); // This removes the element from the array
unset($arr); // This deletes the whole array
As mentioned above, if no key is specified, the maximum of the existing integer indices is taken, and the new key will be that maximum value plus 1.
A lot of useful array operations are here http://sillycat.iteye.com/blog/1543227
The unset() function allows removing keys from an array. Be aware that the array will not be reindexed.
The array_values() function can be used to 'remove and shift'.
$a = array(1 => 'one', 2 => 'two', 3 => 'three');
unset($a[2]);
/* will produce an array that would have been defined as
$a = array(1 => 'one', 3 => 'three');
and NOT
$a = array(1 => 'one', 2 =>'three');
*/
print_r($a);
echo "<br />";
$b = array_values($a);
// Now $b is array(0 => 'one', 1 =>'three')
print_r($b);
http://sillycat.iteye.com/blog/2302285
Code Standard
http://sillycat.iteye.com/blog/2194084
PHP with FPM
http://sillycat.iteye.com/blog/2223621
PHP Lumen
http://sillycat.iteye.com/blog/2238841
http://sillycat.iteye.com/blog/2239826
Install latest PHP on EC2
http://sillycat.iteye.com/blog/2302287
UNIT Test
http://sillycat.iteye.com/blog/2302288
> phpunit --version
PHPUnit 5.1.3 by Sebastian Bergmann and contributors.
References:
PHP Basic1 ~ 3
http://sillycat.iteye.com/blog/768664
http://sillycat.iteye.com/blog/769110
http://sillycat.iteye.com/blog/770369
PHP 1~ 8
http://sillycat.iteye.com/blog/1543227
http://sillycat.iteye.com/blog/2066063
http://sillycat.iteye.com/blog/2302285
http://sillycat.iteye.com/blog/2194084
http://sillycat.iteye.com/blog/2223621
http://sillycat.iteye.com/blog/2238841
http://sillycat.iteye.com/blog/2239826
Language References
http://php.net/manual/en/langref.php
PHP Env
http://sillycat.iteye.com/blog/1634562
http://sillycat.iteye.com/blog/1638638
发表评论
-
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 465NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 361Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 363Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 419Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 463NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 284Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 302Serverless with NodeJS and Tenc ...
相关推荐
1backend 是一个开源项目,它采用了先进的技术栈,包括 Go 语言和 Angular 2(现称为 Angular),构建了一个平台即服务(PaaS)系统。这个项目的目标是提供一个高效、可扩展且易于使用的云基础设施,使得开发者能够...
Ensure seamless implementation of a JavaScript & HTML 5 CSS based frontend and PHP based backend. Learn about problem identification, best strategies, and UI design patterns as well to build a clean, ...
在项目"Backend_Application-main"中,我们可以期待找到与上述知识点相关的源代码、配置文件和资源。通过阅读和分析这些内容,可以深入理解一个基于Java的后端应用是如何设计和实现的。开发者可能还使用了Maven或...
1. 字符串 2. 数组 4. 类型断言 5. 对象的解构与重命名 1. 字符串 2. 数组 4. 类型断言 5. 对象的解构与重命名
Full-Stack Vue.js 2 and Laravel 5 Bring the frontend and backend together with Vue, Vuex, and Laravel 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网...
Learn about application design and structure to start implementing your application. Transform a monolithic application into microservices. Explore the best way to start implementing your application ...
天才宝宝游泳中心后台Koa框架_TCBB_backend_v1.zip 天才宝宝游泳中心后台Koa框架_TCBB_backend_v1.zip 天才宝宝游泳中心后台Koa框架_TCBB_backend_v1.zip 天才宝宝游泳中心后台Koa框架_TCBB_backend_v1.zip 天才宝宝...
php mysql html form generator using this script you can generate html form for your website and it gives out php script and mysql db schema for you to use with out any coding knowledge
the book ends with more advanced projects, which will bring together all the knowledge and expertise developed in the previous chapters to create a practical and functional mobile-application that ...
该项目是一个基于PHP和JavaScript的悟空帮扶-backend系统设计源码,包含3086个文件,其中包括1221个JavaScript文件、554个PHP文件、334个HTML文件、259个LESS样式文件、144个PNG图片文件、112个JSON文件、98个CSS...
### 1. Laravel 框架基础 Laravel 的核心特性包括路由、控制器、中间件、模板引擎(Blade)以及数据库访问层(Eloquent ORM)。它简化了常见的Web开发任务,如表单验证、会话管理和身份验证,使开发者能够更专注于...
1. `.gitignore`:这是一个版本控制系统Git的配置文件,用于指定在提交时忽略的文件和目录,以避免将无用或敏感信息推送到远程仓库。 2. `index.html`:这是Web应用的入口文件,通常包含HTML结构,用于展示网站的...
The book will then focus on writing extendable RxPHP code by developing a code testing tool and also cover Using RxPHP on both the server and client side of the application. With a concluding chapter...
cp .env.example .env 为laravel应用程序生成一个新密钥 php artisan key:generate 运行迁移以创建数据库 php artisan migrate 运行seeder在基础上创建一些用户 php artisan db:seed 运行控制器测试 php artisan ...
将backend/.env.dist文件复制到backend/.env : cp backend/.env.dist backend/.env 将frontend/.env.development.dist文件复制到frontend/.env.development : cp frontend/.env.development.dist frontend/.env...
This describes the standard interfaces and message flow between: 1) A Network Server and a Join Server 2) a Join Server and an Application Server 3) Two Network servers in the case of roaming traffic ...
building real-world, productive and fun applications like text editor, drum machine, game of chess, media player, drawing application and many more. Each subsequent project builds on the skills ...
【标题】"digitalinnovationone_backend_php:Bootcamp后端PHP数字创新1"指的是一个针对数字创新领域,专为提升后端PHP技能的训练营项目。这个项目可能旨在帮助开发者和学习者掌握PHP语言在构建现代Web应用中的核心...