PHP fwrite() º¯Êý

¶¨ÒåºÍÓ÷¨

fwrite() º¯ÊýдÈëÎļþ£¨¿É°²È«ÓÃÓÚ¶þ½øÖÆÎļþ£©¡£

Óï·¨

fwrite(file,string,length)
²ÎÊý ÃèÊö
file ±ØÐè¡£¹æ¶¨ÒªÐ´ÈëµÄ´ò¿ªÎļþ¡£
string ±ØÐè¡£¹æ¶¨ÒªÐ´ÈëÎļþµÄ×Ö·û´®¡£
length ¿ÉÑ¡¡£¹æ¶¨ÒªÐ´ÈëµÄ×î´ó×Ö½ÚÊý¡£

˵Ã÷

fwrite() °Ñ string µÄÄÚÈÝдÈëÎļþÖ¸Õë file ´¦¡£ Èç¹ûÖ¸¶¨ÁË length£¬µ±Ð´ÈëÁË length ¸ö×Ö½Ú»òÕßдÍêÁË string ÒÔºó£¬Ð´Èë¾Í»áÍ£Ö¹£¬ÊÓºõÏÈÅöµ½ÄÄÖÖÇé¿ö¡£

fwrite() ·µ»ØÐ´ÈëµÄ×Ö·ûÊý£¬³öÏÖ´íÎóʱÔò·µ»Ø false¡£

Àý×Ó

<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>

Êä³ö£º

21
VUE