目錄
回复讨论(解决方案)
首頁 後端開發 php教程 新人做一个表单编辑功能的实现,遇到瓶颈求帮助

新人做一个表单编辑功能的实现,遇到瓶颈求帮助

Jun 23, 2016 pm 01:29 PM

<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id" value="<?php echo $row['objid']?>">				<input type="text" name="objname" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					$objname=$_POST["objname"];					$objinfo=$_POST["objinfo"];					$id = $_POST['id'];					$strSql="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";					$result=mysql_query($strSql,$myconn);					if(!$result){    					die(mysql_error());					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製

以上是代码,只能成功修改最后一行,原因是我用while读取后Post选择的总是最后一行,想了有段时间了想不出怎么做
求指导,最好有代码,js可以看懂一点,Jquery咱不会使,毕竟php和js还没完全搞明白


回复讨论(解决方案)

顺带一提,这个页面的前一个页面没有传任何值出来,没有session。
这个页面表单打印全是直接从数据库调的

没人吗

你post的应该只有最后一个记录

input 的name属性名一样,取最后一个

你post的应该只有最后一个记录


这个我知道了,我想求个解决思路或者具体代码来实现我的目的

你每个表单的name得不同,不然只能获取到$_POST[‘objname’]和$_POST['objinfo']两个post值

你每个表单的name得不同,不然只能获取到$_POST[‘objname’]和$_POST['objinfo']两个post值



中改成:




input 的name属性名一样,取最后一个


我是用id调的数据,问题在三个column的name都是一样的,只有value不一样,怎么才能把他们分开分别调用


你每个表单的name得不同,不然只能获取到$_POST[‘objname’]和$_POST['objinfo']两个post值



中改成:





这个思路好!我试试


你每个表单的name得不同,不然只能获取到$_POST[‘objname’]和$_POST['objinfo']两个post值



中改成:





这么一改怎么用post提数据啊?
$objname=$_POST["objname"];怎么写

你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行

你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行


<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id[]" value="<?php echo $row['objid']?>">				<input type="text" name="objname[]" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo[]" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					$i=0;					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[i]"];						$objinfo=$_POST["objinfo[i]"]; 						$id = $_POST["id[i]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}						$i++;					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

我按照你的思路改成这样了
post获得的是一整个表单,我让他逐条更新写入,但是为啥数据库那边没改啊
post获得的值打在这里:Array ( [id] => Array ( [0] => 7 [1] => 8 [2] => 9 [3] => 10 ) [objname] => Array ( [0] => 123123 [1] => 321 [2] => 456 [3] => 654 ) [objinfo] => Array ( [0] => 132132 [1] => 321 [2] => 456 [3] => 654 ) )

你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行


这个数组思路好,赞一个,这样post取值的通过遍历数组就可以区分不同的name:_POST['objname[0],学习了,我想法是通过js修改name值,有点蛋疼!


你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行


<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id[]" value="<?php echo $row['objid']?>">				<input type="text" name="objname[]" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo[]" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					$i=0;					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[i]"];						$objinfo=$_POST["objinfo[i]"]; 						$id = $_POST["id[i]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}						$i++;					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

我按照你的思路改成这样了
post获得的是一整个表单,我让他逐条更新写入,但是为啥数据库那边没改啊
post获得的值打在这里:Array ( [id] => Array ( [0] => 7 [1] => 8 [2] => 9 [3] => 10 ) [objname] => Array ( [0] => 123123 [1] => 321 [2] => 456 [3] => 654 ) [objinfo] => Array ( [0] => 132132 [1] => 321 [2] => 456 [3] => 654 ) )



$_POST["objname[i]"];这个是不是有问题。



你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行


<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id[]" value="<?php echo $row['objid']?>">				<input type="text" name="objname[]" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo[]" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					$i=0;					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[i]"];						$objinfo=$_POST["objinfo[i]"]; 						$id = $_POST["id[i]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}						$i++;					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

我按照你的思路改成这样了
post获得的是一整个表单,我让他逐条更新写入,但是为啥数据库那边没改啊
post获得的值打在这里:Array ( [id] => Array ( [0] => 7 [1] => 8 [2] => 9 [3] => 10 ) [objname] => Array ( [0] => 123123 [1] => 321 [2] => 456 [3] => 654 ) [objinfo] => Array ( [0] => 132132 [1] => 321 [2] => 456 [3] => 654 ) )



$_POST["objname[i]"];这个是不是有问题。


改成$i了还是不行,有引号方面的问题吗?




你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行


<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id[]" value="<?php echo $row['objid']?>">				<input type="text" name="objname[]" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo[]" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					$i=0;					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[i]"];						$objinfo=$_POST["objinfo[i]"]; 						$id = $_POST["id[i]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}						$i++;					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

我按照你的思路改成这样了
post获得的是一整个表单,我让他逐条更新写入,但是为啥数据库那边没改啊
post获得的值打在这里:Array ( [id] => Array ( [0] => 7 [1] => 8 [2] => 9 [3] => 10 ) [objname] => Array ( [0] => 123123 [1] => 321 [2] => 456 [3] => 654 ) [objinfo] => Array ( [0] => 132132 [1] => 321 [2] => 456 [3] => 654 ) )



$_POST["objname[i]"];这个是不是有问题。


改成$i了还是不行,有引号方面的问题吗?


这样想好像不是很好,现在不是可以获得post过来的3个数组了吗,你根据3个数组再组合下,分别插入数据库,不要想着把$_POST[["objname[i]"]插入数据库,而是把$data=array();$data=$_POST["objname"],然后在分别把3个新定义的数组插入数据库。

				if(!empty($_POST)){					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[]"];						print_r($_POST["objname[]"]);						print_r($objname);						$objinfo=$_POST["objinfo[]"];						$id = $_POST["id[]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}					}					echo"修改成功!";									}
登入後複製
登入後複製

想了一下,是不是不用$i也行,但是还是取不出post里数组的数据(感觉是个基础问题)
有劳大佬了


你还要能分条保存啊?那分数组。





这样,获得三个数组。之后你想直接插还是整合成一个数组再插都行


<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id[]" value="<?php echo $row['objid']?>">				<input type="text" name="objname[]" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo[]" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					$i=0;					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[i]"];						$objinfo=$_POST["objinfo[i]"]; 						$id = $_POST["id[i]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}						$i++;					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製
登入後複製
登入後複製
登入後複製
登入後複製

我按照你的思路改成这样了
post获得的是一整个表单,我让他逐条更新写入,但是为啥数据库那边没改啊
post获得的值打在这里:Array ( [id] => Array ( [0] => 7 [1] => 8 [2] => 9 [3] => 10 ) [objname] => Array ( [0] => 123123 [1] => 321 [2] => 456 [3] => 654 ) [objinfo] => Array ( [0] => 132132 [1] => 321 [2] => 456 [3] => 654 ) )



找了半天,你这执行的是$sqlstr,但定义的字符串是$sqlstr2






$limit = 5;
$strSql="select * from news limit ".$limit;
$result=mysql_query($strSql,$myconn);
while($row=mysql_fetch_array($result))
{
$title1=$row['title'];
$link1=$row['link'];
?>





}
print_r($_POST);
if(!empty($_POST)){
for($i=0;$i<$limit;$i++)
{
$title=$_POST["title"][$i];
$link=$_POST["link"][$i];
$id = $_POST["id"][$i];

$strSql = "UPDATE news SET title='".$title."' , link='".$link."' WHERE id='".$id."'";
$result2=mysql_query($strSql,$myconn);
if(!$result2){
die(mysql_error());
}else{
//echo"修改成功!";
}
}


}
?>
title link



我本地测试了一下,这样是可以用的,以上是table里的代码

				if(!empty($_POST)){					while($row=mysql_fetch_array($result))					{						$objname=$_POST["objname[]"];						print_r($_POST["objname[]"]);						print_r($objname);						$objinfo=$_POST["objinfo[]"];						$id = $_POST["id[]"];						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql,$myconn);						if(!$result2){	    					die(mysql_error());						}					}					echo"修改成功!";									}
登入後複製
登入後複製

想了一下,是不是不用$i也行,但是还是取不出post里数组的数据(感觉是个基础问题)
有劳大佬了


我写了print_r($_POST["$objname"]);和print_r($_POST["$objname[]"]); 都没反应

$objname=array();
$bojname=$_POST['bojname'];
$objinfo=array();
$bojname=$_POST['bojname'];
$id=array();
$id=$_POST['id'];
for ($i=0,i $sql='update table_test set objname='.$objname[$i].',objinfo='.$objinfo[$i].' where objid='.$id[$i];
}
试试这个思路


用 $objname=$_POST["objname"][$i]; 吧。






$limit = 5;
$strSql="select * from news limit ".$limit;
$result=mysql_query($strSql,$myconn);
while($row=mysql_fetch_array($result))
{
$title1=$row['title'];
$link1=$row['link'];
?>





}
print_r($_POST);
if(!empty($_POST)){
for($i=0;$i<$limit;$i++)
{
$title=$_POST["title"][$i];
$link=$_POST["link"][$i];
$id = $_POST["id"][$i];

$strSql = "UPDATE news SET title='".$title."' , link='".$link."' WHERE id='".$id."'";
$result2=mysql_query($strSql,$myconn);
if(!$result2){
die(mysql_error());
}else{
//echo"修改成功!";
}
}


}
?>
title link



我本地测试了一下,这样是可以用的,以上是table里的代码


原来是这样写的,受教了

用 $objname=$_POST["objname"][$i]; 吧。

一下子没想到这个,$_POST["objname"][$i]这样的得到post的值,应该就可以插入了,问题应该可以解决了。

用 $objname=$_POST["objname"][$i]; 吧。


多谢大佬帮助,基本上问题都解决了,还差一个定循环里i的终止值为表单长度,这个我自己来吧
真是太感谢了!



用 $objname=$_POST["objname"][$i]; 吧。

一下子没想到这个,$_POST["objname"][$i]这样的得到post的值,应该就可以插入了,问题应该可以解决了。


也多些这位仁兄的热心帮助!太感动了

<?php	$myconn=mysql_connect("localhost","root","");	mysql_select_db("login_test",$myconn);	if(!$myconn){    	echo "连接失败".mysql_error();	}?><html>	<head>		<title>Edit</title>		<link href="css.css" rel="stylesheet" type="text/css" />	</head>	<body>		<form method="POST">			<table>				<tr class="table_head">				<td>objname</td>				<td>objinfo</td>				</tr>				<?php					$strSql="select * from table_test";					$result=mysql_query($strSql,$myconn);					while($row=mysql_fetch_array($result))					{					$objname1=$row['objname'];					$objinfo1=$row['objinfo'];				?>				<tr>				<td><input type="hidden" name="id[]" value="<?php echo $row['objid']?>">				<input type="text" name="objname[]" value="<?php echo $objname1?>" /></td>				<td><input type="text" name="objinfo[]" value="<?php echo $objinfo1?>" /></td>				</tr>				<?php					}				print_r($_POST);				if(!empty($_POST)){					for($i=0;$i< mysql_num_rows($result);$i++){						$objname=$_POST["objname"][$i];						print_r($objname);						$objinfo=$_POST["objinfo"][$i];						print_r($objinfo);						$id = $_POST["id"][$i];						print_r($id);						$strSql2="update table_test set objname='$objname',objinfo='$objinfo' where objid='$id'";						$result2=mysql_query($strSql2,$myconn);						if(!$result2){	    					die(mysql_error());						}					}					echo"修改成功!";									}				?>			</table>			<br>			<div style="display:inline;">				<input type="submit" class="button_black"/>				<input type="button" class="button_black" value="返回" onclick="javascript:document.location.href='test.php'"/>		</form>	</body><?php mysql_close($myconn); ?></html>
登入後複製

这里是最终成型代码
感谢fedcgfedbe和csjazqx的热心帮助!



用  $objname=$_POST["objname"][$i]; 吧。


多谢大佬帮助,基本上问题都解决了,还差一个定循环里i的终止值为表单长度,这个我自己来吧
真是太感谢了!
咱不是大佬。。做这行也没多久的。只是在帮助别人的时候自己也能温习。
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

php中的捲曲:如何在REST API中使用PHP捲曲擴展 php中的捲曲:如何在REST API中使用PHP捲曲擴展 Mar 14, 2025 am 11:42 AM

PHP客戶端URL(curl)擴展是開發人員的強大工具,可以與遠程服務器和REST API無縫交互。通過利用Libcurl(備受尊敬的多協議文件傳輸庫),PHP curl促進了有效的執行

解釋PHP中晚期靜態結合的概念。 解釋PHP中晚期靜態結合的概念。 Mar 21, 2025 pm 01:33 PM

文章討論了PHP 5.3中介紹的PHP中的晚期靜態結合(LSB),允許靜態方法的運行時間分辨率調用以更靈活的繼承。 LSB的實用應用和潛在的觸摸

在PHP API中說明JSON Web令牌(JWT)及其用例。 在PHP API中說明JSON Web令牌(JWT)及其用例。 Apr 05, 2025 am 12:04 AM

JWT是一種基於JSON的開放標準,用於在各方之間安全地傳輸信息,主要用於身份驗證和信息交換。 1.JWT由Header、Payload和Signature三部分組成。 2.JWT的工作原理包括生成JWT、驗證JWT和解析Payload三個步驟。 3.在PHP中使用JWT進行身份驗證時,可以生成和驗證JWT,並在高級用法中包含用戶角色和權限信息。 4.常見錯誤包括簽名驗證失敗、令牌過期和Payload過大,調試技巧包括使用調試工具和日誌記錄。 5.性能優化和最佳實踐包括使用合適的簽名算法、合理設置有效期、

框架安全功能:防止漏洞。 框架安全功能:防止漏洞。 Mar 28, 2025 pm 05:11 PM

文章討論了框架中的基本安全功能,以防止漏洞,包括輸入驗證,身份驗證和常規更新。

如何用PHP的cURL庫發送包含JSON數據的POST請求? 如何用PHP的cURL庫發送包含JSON數據的POST請求? Apr 01, 2025 pm 03:12 PM

使用PHP的cURL庫發送JSON數據在PHP開發中,經常需要與外部API進行交互,其中一種常見的方式是使用cURL庫發送POST�...

自定義/擴展框架:如何添加自定義功能。 自定義/擴展框架:如何添加自定義功能。 Mar 28, 2025 pm 05:12 PM

本文討論了將自定義功能添加到框架上,專注於理解體系結構,識別擴展點以及集成和調試的最佳實踐。

ReactPHP的非阻塞特性究竟是什麼?如何處理其阻塞I/O操作? ReactPHP的非阻塞特性究竟是什麼?如何處理其阻塞I/O操作? Apr 01, 2025 pm 03:09 PM

深入解讀ReactPHP的非阻塞特性ReactPHP的一段官方介紹引起了不少開發者的疑問:“ReactPHPisnon-blockingbydefault....

See all articles