【发布时间】:2012-02-11 06:23:50
【问题描述】:
PHP 类
<?php
class food {
public function __construct ($parameter){
$path = array("something") ;
$this->getPath($path);
}
protected function getPath ($array){
$json = json_encode($array);
}
}
$print = new food(x);
HTML
<!-- ... -->
<form name="form1" action="" method="GET" >
<input type="text" id="hiddenbox" value="<?php $json ?>" />
</form>
<!-- ... -->
我想将$json 值加载到文本框中。但是,不显示该值。如何将$this->getPath() 的返回输入到文本框中?
【问题讨论】:
-
我不会重新编辑以使其再次可读:P 提示:编辑器中的
{}按钮将为您格式化代码,以便正确显示。 -
hmmm.. 哪个 {} 按钮?它是一个html按钮标签
-
我不确定你想在这里实现什么。