zoukankan      html  css  js  c++  java
  • PHP list,explode的使用

    PHP list,explode的使用

    <?php
    header("Content-type: text/html; charset=utf-8");
    echo "explode 使用<br>";
    $student = "Zhangsan,Lisi,Wangwu";
    $studentArray=explode(",",$student);
    echo $studentArray[0]."<br>";
    echo  $studentArray[1]."<br>";
    
    echo "<br>list 使用<br>";
    list($stu1,$stu2,$stu3) = explode(",",$student);
    echo $stu1."<br>";
    echo $stu2."<br>";
    echo $stu3."<br>";
    ?>
    

    1.header("Content-type: text/html; charset=utf-8"); 解决中文乱码问题。

    输出结果:

    explode 使用
    Zhangsan
    Lisi

    list 使用
    Zhangsan
    Lisi
    Wangwu

      

     

  • 相关阅读:
    numpy
    shell进阶2
    python笔记3
    shell进阶1
    记录:Paxos原理、历程及实战
    收藏
    linux fs io
    linux mount 操作
    docker好文收藏
    rbd snap(1)
  • 原文地址:https://www.cnblogs.com/linlf03/p/5909102.html
Copyright © 2011-2022 走看看