background image

    PHP

:

    <?php
    define(myvalue, "10");
    $myarray[10] = "Dog";
    $myarray[] = "Human";
    $myarray['myvalue'] = "Cat";
    $myarray["Dog"] = "Cat";
    print "The value is: ";
    print $myarray[myvalue]."\n";
    >

    A

The Value is: Dog

    B

The Value is: Cat

    C

The Value is: Human

    D

The Value is: 10

    E

Dog

    5

 print()

echo()

    A

print()

echo()

A

    B

echo()

print()

    C

echo()

CLI

PHP

print()

    D

print()

CLI

PHP

echo()

    E

    6

 

PHP

 

    PHP

:

    <?php
    $a = 10;
    $b = 20;
    $c = 4;
    $d = 8;

    $e = 1.0;

    $f = $c + $d * 2;
    $g = $f % 20;
    $h = $b - $a + $c + 2;
    $i = $h << $c;
    $j = $i * $e;
    print $j;
    >