Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try it:</p> <pre><code>&lt;?php function del_cookie($_cookie = array()) { foreach($_cookie as $k =&gt; $kv) { setcookie($k, '', time()-3600); } return; } function add_cookie($_cookie) { foreach($_cookie as $k =&gt; $kv) { setcookie($k, $kv, time()+3600*24*6); } return; } class headers{ var $new; var $vars; var $ss; var $ck; var $_ss; var $_ck; var $_ak; var $_dk; var $error; var $catchs; function _constract() { $this-&gt;new=false; $this-&gt;error=false; $this-&gt;ss=array(); $this-&gt;ck=array(); $this-&gt;_ss=array(); $this-&gt;_ck=array(); $this-&gt;catchs=true; $this-&gt;_ak = false; $this-&gt;_dk = false; return $this-&gt;catchs; } //f function headers($hs = array( "set" =&gt; array( "ss" =&gt; array(), "ck" =&gt; array() ) )) { if(isset($hs['send'])) { $this-&gt;new=$hs['send']; $this-&gt;catchs=true; } if($hs['set']['ck']['true']) { $this-&gt;ck = $hs['set']['ck']; $this-&gt;_ak = true; } /*if($hs['unset']['ss']) { $this-&gt;_ss = $hs['unset']['ss']; } */ if($hs['unset']['ck']['true']) { $this-&gt;_ck = $hs['unset']['ck']; $this-&gt;_dk = true; } return $this-&gt;catchs; } //f function send( $cfg_cookie_time=6, $plus=true ) { if(is_array($this-&gt;ss)) { session_start(); foreach($this-&gt;ss as $session){ $_SESSION['session'] = $session; } } if($this-&gt;_dk) { del_cookie($this-&gt;_ck); } if($this-&gt;_ak) { add_cookie($this-&gt;ck); } if($this-&gt;new) { header("location: ".$this-&gt;new); $this-&gt;catchs=false; } header("X-Powered-By: PHP ".phpversion()."/FxPHP"); //header("HTTP/1.0 404 Not Found"); return $this-&gt;catchs; } //f } // class $hr = new HEADERS( array ( "set" =&gt; array ( "ck"=&gt; array( "true" =&gt; "" ), "ss"=&gt; array ( "true" =&gt; "") ), "unset" =&gt; array ( "ck"=&gt; array ( "true" =&gt; "YES", "Test" =&gt; "1" ), "ss"=&gt; array ( "true" =&gt; "") ) ) ); print_r( $_COOKIE).print_r($hr-&gt;send()); /* " f" =&gt; "" , " sf" =&gt; "", "my"=&gt; "" , print_r(getallheaders()); print_r(setcookie('sd', 'dsds', 3600*6)); */ ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload