codehaven - php snippets - coding help
Generic filters
Exact matches only
  • Check if PHP variable contains specific text

    23rd December 2014

    Php - Strings

    php codehaven

    If you want to check that a PHP variable contains specific text, then this code could be useful.

    Please note: that it is case specific. If you are searching for ‘DOG’ and you have found ‘dog’ it will not trigger successfully.
    You will need this script to make the PHP variable to lowercase.

    Was this code snippet helpful?