what replaces NOT in VB in PHP??

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

TheIceman5
New php-forum User
New php-forum User
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm
Contact:

what replaces NOT in VB in PHP??

Postby TheIceman5 » Wed Jan 22, 2003 6:29 pm

in visual basic you can have

if NOT isnumeric("sss") then do this

how do you do this in php? it doesnt like the word NOT. this dont work

if(NOT is_numeric("sss")){ do this }

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Thu Jan 23, 2003 3:30 am

You can use var_dump:
here you are an example with some types -->

Code: Select all

$a = array(1 => 'one', 2 => 'two', 3 => 'three');
class foo
{
    function do_foo()
    {
        echo "Doing foo.";
    }
}

$bar = new foo;
echo "<pre>";
var_dump("hello",43,34.56,true,$a,$bar);//this is the key
echo "</pre>";

outputs -->
string(5) "hello"
int(43)
float(34.56)
bool(true)
array(3) {
[1]=>
string(3) "one"
[2]=>
string(3) "two"
[3]=>
string(5) "three"
}
object(foo)(0) {
}


User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Thu Jan 23, 2003 3:35 am

Sorry...
I didn't understand you :)
NOT --> !
An example:

Code: Select all

if ( !isset($my_var) ){
 blah....
}

or

Code: Select all

if ( $my_var != $my_value ){
 blah....
}

TheIceman5
New php-forum User
New php-forum User
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm
Contact:

Postby TheIceman5 » Fri Jan 24, 2003 2:42 pm

yep thanks, i should have remembered, mental blank, i remember now. Thats what you get when you start coding in 3 different languages, you start putting one language in with the other and wonder why you get errors. i dunno how i forgot about the !.
later...


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests

cron