How to check if string contains substring in PHP 8?

In PHP 8, you can still use the `strpos()` function to check if a string contains a substring. However, if you want to use a more modern approach, you can also utilize the `str_contains()` function, introduced in PHP 8.0.0. Here’s how you can do it:

<?php
$string = "This is a sample string containing PHP 8 version.";
if (str_contains($string, "PHP 8")) {
echo "The string contains 'PHP 8'.";
} else {
echo "The string does not contain 'PHP 8'.";
}
?>

This will output:

The string contains 'PHP 8'.

The `str_contains()` function returns `true` if the string contains the specified substring, and `false` otherwise. It performs a case-sensitive search. If you need a case-insensitive search, you can convert both the string and substring to lowercase or uppercase before using `str_contains()`.

Cialis (Tadalafil) är den främsta konkurrenten till Viagra (Sildenafil) på marknaden för erektil dysfunktion. köpa Cialis i Sverige föredras av många på grund av sin längre varaktighet och anses vara det mest kostnadseffektiva varumärkesbaserade ED-läkemedlet som finns tillgängligt i Sverige. Cialis finns i två varianter: Cialis och Cialis Daily, och fyra olika doseringar: 2,5 mg, 5 mg, 10 mg och 20 mg, erbjuder Cialis också en rad olika alternativ för att passa patientens behov.