$c = E_ERROR | E_WARNING | E_NOTICE; echo $c, "=", decbin($c), "\n"; $d = E_ALL ^ E_NOTICE; echo $d, "=", decbin($d), "\n"; $url = "https://www.uoo.com/test/index.php?v=std&c=123#ting"; $u = parse_url($url); $path = __FILE__; $o = pathinfo($path); //var_dump($o); //var_dump($u); //----------------------------------------------------- class tem { function __construct($a) { $this->a = $a; } function dis() { echo $this->a; } function __destruct() { $this->a = null; echo "destory it!"; } } $a = new tem("hi"); $a->dis(); unset($a); // Here will call __destruct();
function preview() { tem_load('code/wfpl/metaform/preview.html'); tem_set('form_name', $GLOBALS['form_name']); tem_set('fields', $_REQUEST['fields']); $preview_tem = new tem(); $preview_tem->load_str(make_html(false)); if ($GLOBALS['opt_db'] == 'Yes') { $preview_tem->show('new_msg'); } $fields = get_fields(); foreach ($fields as $field) { list($name, $type, $input, $format, $sql) = $field; if ($type == 'pulldown') { pulldown($name, array('option 1', 'option 2', 'option 3')); } } $preview = $preview_tem->run(); unset($preview_tem); $preview = ereg_replace('type="submit"', 'type="submit" disabled="disabled"', $preview); tem_set('preview', $preview); tem_show('hiddens'); set_form_action(); tem_output(); }