PHP STATIC VARIABLE EXAMPLE

  • PHP only supports static variables within the scope of a function definition
  • Static variables are, in fact, variable. The “static” means that the variable retains its value between calls to whatever that variable’s scope is (function, class, procedure, etc.)
  • Variables in PHP can only be static within the context of a function. Once a script exits, all variables are released. If you need to share variables between scripts, then you’ll need to either use sessions (I would think this would usually be the best solution), send them via form POST or GET data, or use a database for data persistence.

here is an example paste of static variable in PHP

you can see the output here

 

Advertisements

A clock-style timepicker for Bootstrap (or jQuery)

ClockPicker

Browser support

All major browsers are supported, including IE 9+. It should look and behave well enough in IE 8.

Device support

Both desktop and mobile device are supported. It also works great in touch screen device.

Dependencies

ClockPicker was designed for Bootstrap in the beginning. So Bootstrap (and jQuery) is the only dependency(s).

Since it only used .popover and some of .btn styles of Bootstrap, I picked these styles to build a jQuery plugin. Feel free to use jquery-* files instead of bootstrap-* , for non-bootstrap project.