⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 7-7.php3

📁 linux操作系统中 php 核心编程所有例程 都是一些很不错的案例
💻 PHP3
字号:
<HTML>
<HEAD>
<TITLE>Figure 7-7</TITLE>
</HEAD>
<BODY>
<?
	/* 
	** open file for writing 
	*/
	$myFile = fopen("file7-7.txt","w");
	
	/*
	** make sure the open was successful
	*/
	if(!($myFile))
	{
		print("Error: ");
		print("'file7-7.txt' could not be created\n");
		exit;
	}

	 
	// write some lines to the file 
	fputs($myFile, "Save this line for later\n");
	fputs($myFile, "Save this line too\n");

	fclose($myFile); // close the file


	/*
	** open file for reading
	*/
	$myFile = fopen("file7-7.txt","r");

	/*
	** make sure the open was successful
	*/
	if(!($myFile))
	{
		print("Error:");
		print("'file7-7.txt' could not be read\n");
		exit;
	}

	while(!feof($myFile))
	{
		// read a line from the file 
		$myLine = fgets($myFile, 255);
	
		print("$myLine <BR>\n");
	}

	fclose($myFile); // close the file

?>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -