Newbie needed help with searching within arrays
Posted: Fri Feb 26, 2010 4:11 am
Hi Everyone - joined the forums as looking for a decent place to learn some more PHP (Im a beginner so please be nice!)
So my first ask for help is as follows!
I am working on a Ban feature for my forums, and what i woudl like to do, is search within an array, and if an exact match is found, execute the statment...
my current code...
What its currently doing, is when I am adding a "name" it will execute the function even if one letter of the name is present.
For example if i want to ban Monkey, and I only type in M it will still ban Monkey. I want it to require the WHOLE name, I think it needs a == but i dont know what to do!!!
Any help would be greatly appreciated!
Many thanks
So my first ask for help is as follows!
I am working on a Ban feature for my forums, and what i woudl like to do, is search within an array, and if an exact match is found, execute the statment...
my current code...
Code: Select all
<if test="in_array( $this->member->getProperty['name'] , explode(',' , $this->settings['eodc_chat_bar_ban']))">
{
}
</if>
For example if i want to ban Monkey, and I only type in M it will still ban Monkey. I want it to require the WHOLE name, I think it needs a == but i dont know what to do!!!
Any help would be greatly appreciated!
Many thanks