Home > Backend Development > PHP Tutorial > File Writing_PHP Tutorial

File Writing_PHP Tutorial

WBOY
Release: 2016-07-13 17:49:00
Original
861 people have browsed it

//index.php 页面  
$incpeizhi="inc.peizhi.php"; 
$arr=array('mark_h','mark_w','mark_name','mark_url','mark_type'); 
extract($_POST); 
echo $mark_name; 
echo "
"; 
$configstr = ""; 
    foreach($arr as  $v) 
    {    
    echo $v;     
    ${$v} = str_replace("'","",${$v}); 
    $configstr .= "${$v} = '".${$v}."';rn"; 
    } 
$configstr = "<"."?phprn".$configstr."?".">rn"; 
$fp=fopen($incpeizhi,"w"); 
fwrite($fp,$configstr); 
fclose($fp); 
 
//=======================  
//inc.peizhi.php 页面  
$mark_h = '200'; 
$mark_w = '150'; 
$mark_name = 'xinxi'; 
$mark_url = 'www.2cto.com'; 
$mark_type = '1'; 
?> 
//===================  
//form页面  

 
H:
 
W:
 
type:
 
url:
 
name:
 
 
 

摘自 chaojie2009的专栏

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478377.htmlTechArticle//index.php 页面 $incpeizhi=inc.peizhi.php; $arr=array(mark_h,mark_w,mark_name,mark_url,mark_type); extract($_POST); echo $mark_name; echo br; $configstr = ; foreach($arr as $v) {...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template