1 <?php 2 $document_root =$_server['document_root']; 3 ?> 4 5 <html> 6 <head> 7 <title>bob's auto parts -customer orders </title> 8 </head> 9 <body>10 <h1>bob's auto parts</h1>11 <h2>customer orders</h2>12 13 <?php14 /*15 $a=56;16 if(!is_double ($a)) //测试is_int、is_double 、函数17 echo "<p><strong>isn't double</strong ></p>";18 echo gettype($a).'<br/>';19 settype($a,'double');20 echo gettype($a).'<br/>';21 */22 23 @$fp =fopen("$DOCUMENT_ROOT/orders/orders.txt",'rb');24 if (!$fp){25 echo"<p><strong>No orders pending.26 please try again later.</strong></p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/2085">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679986390996.png" alt="表单大师AI">
</a>
<div class="aritcle_card_info">
<a href="/ai/2085">表单大师AI</a>
<p>一款基于自然语言处理技术的智能在线表单创建工具,可以帮助用户快速、高效地生成各类专业表单。</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="表单大师AI">
<span>74</span>
</div>
</div>
<a href="/ai/2085" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="表单大师AI">
</a>
</div>
";27 exit ;28 }29 30 /*31 isset ();32 33 empty()34 35 */36 //读取每行37 while (!feof($fp)){38 $order = fgets($fp,1024); //fgets()每次读取一行,遇到\n 、eof 、或者是998b结束。默认1k=1024b39 echo $order."<br/>"; //fgetss() 和fgets()一样的功能,但是能过滤掉包含php和html的标记40 } //fgetss(resource fp,int length,string[allowable_tags]) 把不过滤的标记放在allowable_tags中41 //$order = fgetss($fp,999,"<p>,<br/>");42 // fgetcsv($fp,1024,"\t") 意思是遇到换行43 44 /*45 读取整个文件,46 readfile("$DOCUMENT_ROOT/orders/orders.txt");47 fpassthru($fp) ; //fp是一个指针48 $filearray =file("$DOCUMENT_ROOT/orders/orders.txt") 49 //功能和readfile一样,但是每一行是字符串数组的一个元素50 */ 51 52 /*53 通过字符来输出整个文件54 while(!feof($fp))55 $char =fgetc($fp);56 if(!feof($fp))57 echo ($char =="\n"?<br/>:$char); 58 */ 59 // fread($fp,int length) 读取任意长度,或者到eof 60 61 /*62 file_exists("$DOCUMENT_ROOT/orders/orders.txt");63 filesize();64 unlink("$DOCUMENT_ROOT/orders/orders.txt") //删除一个文件65 66 rewind($fp); //重新跳到开始指针67 fseek ($fp); //找到位置 字节数68 ftell ($fp); //显示出位置69 70 71 */ 72 73 ?>74 </body>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号