If php variable contains certain word echo this

I have a php variable $colour.
What I need to set up is a script that will check if the value of this variable contains certain data and if so will echo something.
For example:
$colour = ‘Indigo Blue’;
I need to set up a statement that will check if the colour variable contains the word Blue anywhere and if so will echo the word “BLUE”

Can anyone tell me how to code this please?

Sorry if this is a really simple question that I am missing but I can’t work this one out!

Thanks for nay help in advance

Here you go. See [fphp]stripos[/fphp] for more. :slight_smile:


<?php
$colour = 'Indigo Blue';

if(false !== stripos($colour, 'blue')){
  echo 'Blue';
}