Skip to content
Advertisement

Tag: default-value

PHP variable “default value”

I want to get a value from the session, but use a default if it is not defined. And ofcourse I want to circumvent the PHP notice. You can write a function that does this Example in action Is there a way to do this without defining this function in every file? Answer From PHP 7, you can now use

Advertisement