gpt4 book ai didi

php - 使用 http GET php 从数组中获取一个元素

转载 作者:数据小太阳 更新时间:2023-10-29 02:44:20 24 4
gpt4 key购买 nike

我在 html 文档中使用一个表单,我有这个输入:

<input type="hidden" name="codigo">
<xsl:attribute name="value">
<xsl:value-of select="codi"/>
</xsl:attribute>
</input>

例如,如果我在我看到的 URL 中按下提交按钮:?codigo=4,在我的 php 代码中,我在 document.xml 中添加一个子“comentario”用于选择 finca :

$finca = $fincas->finca[$_GET['codigo']]->comentarios->addChild('comentario');

问题是我的服务器无法将 $_GET 参数处理成数组,我需要在特定的 finca 中添加子项。我尝试使用固定参数(如“1”)来完成它,并且它正在运行。

有什么办法可以解决吗?

最佳答案

ok,看了半天我找到了一个很简单的解决办法,就是做一个Parse int, (int)

关于php - 使用 http GET php 从数组中获取一个元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36280962/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com