Created
November 17, 2013 01:58
-
-
Save kojiromike/7508110 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Variable for keeping track if a user has posted. Set to false initially. If found it will be changed to true. | |
$alreadyPosted = false; | |
// Loop through all the posts | |
foreach ($posts_array as $post) { | |
// Check to see if the person in the database ($post['name']) matches the supplied name ($name) | |
if ($post['name'] == $name) { | |
// It does. Great. Set the variable to true. | |
$alreadyPosted = true; | |
break; | |
} | |
}?> | |
<div | |
<?php | |
if ($alreadyPosted) { | |
echo 'id="highlight"'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment