Page 1 of 1

SB explain this function?

Posted: Mon Jun 30, 2003 10:14 am
by TLPD
SB tell me what is it used for??
isset();
intval();

and how to use it? :lol:

Posted: Mon Jun 30, 2003 10:39 am
by Stoker

Code: Select all

<?php

  //  a ! in front of an expression is a ngeation (NOT)

  if (!isset($_REQUEST['beer'])) 
  {
    echo 'No beer has been selected, I''ll go for my usual!<br>';
    $beer = 'Sam Adams';
  }
  else
  {
    $beer = stripslashes($_REQUEST['beer']);
  }
  echo 'My choice of beer is '.$beer.'!<br>'."\n";

  # If the variable was never assignes, isset() returns false
  # Just as useful is empty() that returns false if not assigned or if value is zero ir an empty string

?>
intval simply returns the integer part of a string or float (or any other with a numeric in it)

Posted: Tue Jul 01, 2003 3:20 am
by twigletmac

Posted: Tue Jul 01, 2003 3:43 am
by []InTeR[]
Rule nr1. :)
Don't just post RTFM - try and give a link to the section of the manual that is relevant.

Nice done... follow the rules. :twisted: :twisted:

Posted: Tue Jul 01, 2003 3:47 am
by cactus
Erm, Mac did....

Regards,

Posted: Tue Jul 01, 2003 3:50 am
by []InTeR[]
He DID follow the rules.. is what i ment...

Posted: Tue Jul 01, 2003 4:05 am
by twigletmac
[]InTeR[] wrote:He DID follow the rules.. is what i ment...
She did... (she also wrote the rules so she really should pay attention to them).

Mac

Posted: Tue Jul 01, 2003 4:12 am
by []InTeR[]
Sorry Mac, She....
I know that... :(