php var default value code example Example: php assign value to variable with default $default_carat_min = $_COOKIE["diamond-search_caratMin"] ?: "0.25";