Jump to content
php.lv forumi
Sign in to follow this  
newnew

kā pieņemts rakstīt

Recommended Posts

ar empty() pietiek, jo tas sevī ietver arī isset pārbaudi.

Share this post


Link to post
Share on other sites

Tik tad būs jāliek priekšā @ simbols. Jo ja mainīgais nav definēts, tad empty bļaustīsies (pie ieslēgtām noticēm).

Share this post


Link to post
Share on other sites

Tātad secinājums -

ja PHP 5+, tad pietiekami korekti ir rakstīt if (empty($var))

ja PHP 5-, tad korekti ir rakstīt if (@empty($var))

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...