15Сʱ----޸ĳԼЩ<һ>|peilei|ܶѶphpʶ,ͣ޸ı˵ĳ,Ϊ޸ڽ.鿴ʱ,phpĺ޵ж,ⱻ.ȵ.Լں.רŶĻʱѧϰphpԼ㶫ˡ<br><br> &nbsp; &nbsp; &nbsp; ,ҲμѧУһް,ʦϿν,ĩҪ,Ǻ,,ȻܹԼд򵥵Ĵ.<br><br> &nbsp; &nbsp; &nbsp; &nbsp;,ľ޸ĳеhtml,޷Գ޸ĵ,лĳ,:ifelse.,ͬ˾ʺ.ֿ߿.ҵΪֹ,ʹóõĺȻҪֲ,Ȼд.<br><br> &nbsp; &nbsp; &nbsp; &nbsp; ,ϻ˵,ǽһ׶ΰ<br><br> &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp;ܹ޸ĳ,ͬѧﶼҳּ.ʼʲôǱ˵,ⵢʱ.ԼǸıռ,ǾͿȴϸһһֿʼ.ܼ,ֻм򵥵ж,һѳ˵д޵ϸ.<br>|1073712073|218.68.248.79|ran|checkbox____|none|none||none||
Re:15СʱǴһ򵥵ļʼ|peilei|Ĺ:ˢһҳ,һ.<br><br><br><br> &nbsp;Code: [Copy to clipboard] &nbsp; <br><?<br>$datafile=&quot;data.txt&quot;;<br>$fp1=fopen($datafile,&quot;r&quot;);<br>$num=fgets($fp1,10);<br>$num=trim($num);<br>fclose($fp1);<br>echo &quot;ǵ&quot;.$num.&quot;λ&quot;;<br>$fp2=fopen($datafile,&quot;w&quot;);<br>$num=$num+1;<br>fputs($fp2,&quot;$num&quot;);<br>fclose($fp2);<br>?> <br> <br><br><br>ǶԸóϸ<br>|1073712116|218.68.248.79|ran|checkbox____|none|none||||
Re:15Сʱ----޸ĳԼЩ<һ>|peilei|<?<br><br>/* phpļ<? ?><?php ?>ŵ,ִеʱܹȡñǩеִ.*/<br><br>/*<br>趨ݴ洢ļ,ΪphpеıǴ洢ڷڴе,ִԺʧ,Ҫıķߵ,ʹdata.txt,ǿԸ.phpеıǰ涼һ$,,$ŵĶǱ.<br>*/<br>$datafile=&quot;data.txt&quot;;<br><br><br>/*һǴļ,ʹfopen(),fopenǴļĺ,ú,һļ,һǴ򿪷ʽ.籾ʹ&quot;r&quot;ʽ򿪾ֻʽ.$fp1һ,ʲôǾ?ͺñʹˢʱ,ͨʹˢıˢʹݸɾ.ô$fp1ͺñǸˢ,phpͨ$fp1,ﵽdata.txtݴ洢ļ.һ仰:ʹfopenļ,ҰѴ򿪵ļľݸ$fp1˴fopenʹ÷Ȼʣοվphpֲ[url]http://www.iphp.org/manual/function.fopen.html[/url]<br>fopenʹ÷<br>*/<br>$fp1=fopen($datafile,&quot;r&quot;);<br><br><br>/*<br>һ仰ʹ:ļȡ<br>ʹú:fgets(&quot;&quot;,&quot;ȡļݵֽ&quot;);,õĽͨȡ$fp1,ﵽȡļݵĿ.õ$numļǰ10ֽ.<br>*/<br>$num=fgets($fp1,10);<br><br><br>/*<br>trim();ȥַǰĿոģ<br>$num=&quot;123 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;;<br>trim($num)123;<br>*/<br>$num=trim($num);<br><br>/*<br>fcloseرļ,fcloseҪĲ$fp1<br>*/<br>fclose($fp1);<br><br>/*<br><br>echoʹ÷Ҷ֪,൱print();ҳ˼<br>ַͱ֮ʹ&quot;.&quot;,Ϳphpдӡ.ӷ&quot;.&quot;ʹ÷Ҫ.Ҫȷ,οվphpֲ[url]http://www.iphp.org/manual/language.operators.string.html[/url]<br>йַӵĲ.<br>*/<br>echo &quot;ǵ&quot;.$num.&quot;λ&quot;;<br><br><br>/*<br>ʹfopenļ򿪷ΪwΪw򿪵ļΪֻдģʽļԭڣ򴴽ļļڣļݡȻд룬ǴļȻѾݸ$fp2.<br>*/<br>$fp2=fopen($datafile,&quot;w&quot;);<br><br>/*һ*/<br>$num=$num+1;<br><br>/*һԺдļfputsʹ÷ܼ򵥣һļڶҪдݣfputsʹ÷壬οվphpֲе[url]http://www.iphp.org/manual/function.fputs.html[/url]*/<br>fputs($fp2,&quot;$num&quot;);<br><br>/*رմ򿪵ļ*/<br>fclose($fp2);<br>?>|1073712152|218.68.248.79|ran|checkbox____|none|none||||
