找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 php教程 查看内容

$line[一]=intval($line[1]);//这个这样写是什么意思

作者:模板之家 2020-10-31 15:17 221人关注

$line=intval($line);//这个这样写是什么意思??php//createshortvariablename$DOCUMENT_ROOT=$_SER,$line=intval($line);//这个这样写是什么意思

Order Date
            Tires
            Oil
            Spark Plugs
            Total
            Address
         
";

  for ($i=0; $i<$number_of_orders; $i++) {
    //split up each line
    $line = explode("\t", $orders[$i]);

    // keep only the number of items ordered
    $line[1] = intval($line[1]); 
    $line[2] = intval($line[2]);
    $line[3] = intval($line[3]);

    // output each order
    echo "
             
             ".$line[1]."
             ".$line[2]."
             ".$line[3]."
             ".$line[4]."
             

          ";
  }

  echo "
$line[1] = intval($line[1]); //这个这样写是什么意思?

  //create short variable name
  $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
?>


  Bob's Auto Parts - Customer Orders


Bob's Auto Parts

Customer Orders


  //Read in the entire file.
  //Each order becomes an element in the array
  $orders= file("$DOCUMENT_ROOT/../orders/orders.txt");

  // count the number of orders in the array
  $number_of_orders = count($orders);

  if ($number_of_orders == 0) {
    echo "

No orders pending.
          Please try again later.

";
  }

  echo "\n";
  echo "
".$line[0]."".$line[5]."
";
?>




 $line[1] = intval($line[1]); //这个这样写是什么意思? intval手册是这样描述intval通过使用特定的进制转换(默认是十进制),返回变量 var 的 integer 数值。但是将这个integer数值赋给$line[1]起到什么作用?
原作者: 互联网 来自: 网络收集

全部回复(0)