每个人的名字跟年龄并排显示第2个人切换下一排
   先谢谢各位大神 

解决方案 »

  1.   

    创建一个2维的数组,然后用fputcsv保存成csv即可
      

  2.   

    获取输入的值,通过php文件操作函数保存即可。
      

  3.   


    <?php 
    if(!empty($_POST['submit'])){
    $name = $_POST['name'];
    $age = $_POST['age'];
    $fhand = fopen('1.txt','a+');
    fwrite($fhand,$name.$age."\r\n");
    fclose($fhand);
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>我靠</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="zh-CN" />
    </head>
    <body>
    <form action="" method="post">
    名字:<input type="text" name="name"/>
    年龄:<input type="text" name="age"/>
    <input type="submit" name="submit" value="提交"/>
    </form>
    </body>
    </html>
      

  4.   


    这里需要注意的是,fwrite中的换行操作,必须使用双引号,单引号不认转义字符- -!
    http://www.5idev.com/p-php_types_string.shtml