/    Sign up×
Community /Pin to ProfileBookmark

isset multiple variables

ey guys.
Is there a way to isset multiple vars in one line so that if just one variable is set then it will return true?
eg.

[CODE]
$var1= “one”;
if (isset($var1, $var2)) {
//do something
}
[/CODE]

I tried the above with no luck. I’m wondering if its ‘&’s or ‘+’s or ‘.’s instead of commas.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@craigsmanauthorJul 19.2006 — I should ad that the above will return false as not ALL of the vars are set. I want it to return true as AT LEAST ONE IS set.
Copy linkTweet thisAlerts:
@cridleyJul 19.2006 — [code=php]$var1= "one";
if (isset($var1) || isset($var2)) {
//do something
}[/code]


???
Copy linkTweet thisAlerts:
@craigsmanauthorJul 19.2006 — Beauty! Thanks mate
Copy linkTweet thisAlerts:
@cridleyJul 19.2006 — [URL=http://www.phpbuilder.com/manual/language.operators.logical.php]http://www.phpbuilder.com/manual/language.operators.logical.php[/URL]
×

Success!

Help @craigsman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...