首页 > 代码库 > php基础24:数组range

php基础24:数组range

<?php
    $numbers = range(1, 10);
    echo "<pre>";
    var_dump($numbers);
    echo "</pre>";

    echo "<hr>";

    $letters = range(‘a‘, ‘z‘);
    echo "<pre>";
    var_dump($letters);
    echo "</pre>";
    echo "<hr>";

    $friends = array("name"=>"gaoxiong","age"=>23);

    foreach ($friends as $key => $value) {
        echo $key."----".$value."<br>";
    }
?>

php基础24:数组range