Jump to content

WildCard in if statement


SirChick

Recommended Posts

What do you mean as far as Wildcar?

basically you have

$Education1

$Education2

$Education3

$Education4

 

and you want to check to see if any ALL of them not-equal??? English^

or do you want to see if ANY of them not-equal English^

 

if you want to check to see if ANY of them do..then use || instead of &&

 

is that what you were trying to do? or did i misunderstand

 

Link to comment
Share on other sites

<?
If ($Education1 != 'English^' && $Education2 != 'English^' && $Education3 != 'English^' && $Education4 != 'English^'){
?>
<a href='educationprocess.php?education=English1'>English Grade 1</a>
<br>
<br>
<?
}
?>

 

 

This is what i got ^

 

It should echo but it won't echo it.

Link to comment
Share on other sites

Firstly, you forgot to echo your text, so of course nothing is showing.

 

Also, wouldn't it be easier to substr() what you need off the variable before you compare?

 

<?php
$x = substr ($Education1, 0, 7);
if ($x <> 'English')
    echo 'whatever';
?>

Link to comment
Share on other sites

Firstly, you forgot to echo your text, so of course nothing is showing.

 

Also, wouldn't it be easier to substr() what you need off the variable before you compare?

 

<?php
$x = substr ($Education1, 0, 7);
if ($x <> 'English')
    echo 'whatever';
?>

 

 

it echo's

 

<a href='educationprocess.php?education=English1'>English Grade 1</a>

 

 

as you see its withing the it's curly bracket zone {}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.