Abandoned fish--how long does PHP take to get from getting started to giving up? 4

Source: Internet
Author: User

Today's Lesson: PHP 3-Day Foundation Consolidation video Tutorial "Yan 18"

1, arithmetic operators/subtraction, etc., divisor cannot be 0

2 comparison operators

$a = 5;

$b = 3;

$c = ($a > $b);

Var_dump ($c);

echo ' <br/> ';

$c = ($a = = $b);

Var_dump ($c);

echo ' <br/> ';

All equals

$a = 5;

$b = ' 5 ';

Var_dump ($a = = $b);

Var_dump ($a = = = $b);

echo ' <br/> ';

All equals the requirement type and value all want to wait

Interview questions

$a = 0;//1 2 3 false

if ($a = = = False) {

echo ' not found ';

}else{


Echo ' found it ';

}

33-tuple operator

Ternary operators

Given 2 numbers, find the bigger one.

$a = 5;

$b = 10;

$c = null;

if ($a >= $b) {

$c = $a;

}else{

$c = $b;

}

Var_dump ($c);

$c = ($a >= $b? $a: $c);

Var_dump ($c);

echo ' <br/> ';

4 logical operators

logical operators

You can marry a car if you have a room.

$h = true;

$c = true;

if ($h = = = True) {


if ($c = = = True) {

echo "married";

}else{

echo "regret";

}

}


if ($h = = False) && ($c = = true)) {

Echo ' Marry ';

}else{

echo ' regret ';

}

The fourth day, learning less today, mainly is sleepy, or did not give up

This article from "A Big big waste fish" blog, declined reprint!

Abandoned fish--how long does PHP take to get from getting started to giving up? 4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.