Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

what replaces NOT in VB in PHP??

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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 }
TheIceman5
New php-forum User
New php-forum User
 
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm

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

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....
}
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

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...
TheIceman5
New php-forum User
New php-forum User
 
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron