Arrays Question clearification and filter...
Ok, Arrays have been a bit difficult for me to understand how they work and what they can do for me...
PHP Code:
$sentence = array("Part","of","an","array");
Thats an example of an array...
I am trying to create a filter for my site's comment board...
*Does anyone know a link to like all the bad words in the universe lol... cuz i don't use a variety of language...*
But, instead of doing this:
PHP Code:
if($comment==badwordthatidon'tfeellikegettingbannedfor){
echo "****";
}
Then looping that... which would not be fun...
I saw this in W3 schools... but it has got arrays in it *which confuse me...*
if someone could explain how this calls the individual parts...
PHP Code:
<?php
$arr = array("Hello" => "Hi", "world" => "earth");
echo strtr("Hello world",$arr);
?>
I think I've got a thought on this...
So if
$arr = array("Hello" => "Hi", "world" => "earth");
Basically the => says turn this to that... then that to that...
Am I correct? Thanks...
Thanks