<?php
$actual = 'There was an error performing the requested operation. Please try again or contact us for assistance.';
$text = 'There was an error performing the requested operation. Please try again or contact us for assistance.';
$actual = preg_replace('/\s+/u', ' ', $actual);
$regex = '/'.preg_quote($text, '/').'/ui';
$message = sprintf('The text "%s" appears in the text of this page, but it should not.', $text);
var_dump(!preg_match($regex, $actual));
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
bool(false)