Re: [PHP] Resolving a PHP Notice Error

[email protected] (Sebastian Krebs)
Newsgroups php.general
Message-ID <CALtuQzBtxZk_FbZCb5Z6kaii-v6Q4a-BsugCQXoLUBrN=axTPg@mail.gmail.com>
2013/9/17 Ron Piggott <[email protected]>

>
> I am wanting to establish a default sort by preference when the user
> hasn’t specified one.  I setup to test this with:
>
> <?php
>
> if ( !is_set( $sort_by_preference ) ) {
>
>     $sort_by_preference = "government_wording";
>
> }
>
> ?>
>
> But I am receiving a Notice error:
>
> Notice:  Undefined variable: sort_by_preference in GIFI_codes.php on line
> 11- Line 11 is “if ( !is_set( $sort_by_preference ) ) {“What is the correct
> way to test this without triggering a Notice error?Ron
> Ron Piggott
>

Because actually you are looking for isset() (not is_set()).


>
>
>
> www.TheVerseOfTheDay.info
>



-- 
github.com/KingCrunch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.