To check for specific words

Asked 2 years ago, Updated 2 years ago, 47 views

$a = 'How are you?';

if ($a contains 'are')
    echo 'true';

How do I check php for specific words in a string in this way?

php string

2022-09-22 22:08

1 Answers

if (strpos($a, 'are') !== false) {
    echo 'true';
}

Do it like this


2022-09-22 22:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.