PHP Class
<?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>
<!-- ... -->
I want to load the $json
value into the textbox. However, the value is not displayed. How do I get the return of $this->getPath()
into the textbox?