PHPEdit.net Community
   
1 2 3 4
Tutorials Tips Pasties Code Snippets
 

Home > Code snippets > PHP

Code Snippets from Category PHP

Display code snippets from subcategory: Arrays (1), Strings (2), Files (2)

Cookie Class

Cookie Class
very easy to use
 
set cookie: Cookie::set('car','abc 123');
get cookie: Cookie::get('car'); //return 'abc 123'
del cookie: Cookie::del('car'); //delete cookie car
del all cookies: Cookie::delAll();
isset cookie??: Cookie::exists('car'); //return bool value
empty cookie??: Cookie::isEmpty('car'); //return bool value

Removing Register Globals and Magic Quotes

If you are in the situation where you can not control is register globals are on or if magic quotes are on you need an easy way to remove them. Luckily with a single include file you can remove these items. Whether you are transitioning away from them or are on a host where you can not turn them off this will help you to ensure that the variables are cleaned out.

Got one? Create it now.

View the most popular snippets.

Subscribe to comments Want to be up-to-date? Subscribe to snippets in your favorite feed reader.

 
PHPEdit User Community, © 2008 WaterProof SARL
Powered by PHPEdit