When a value can be of "unknow" type, I find this conversion trick usefull and more readable than a formal casting (for php7.3+):
<?php
$time = time();
$string = 'This is a test: ' . $time;
echo (strpos($string, $time) !== false ? 'found' : 'not found');
echo (strpos($string, "$time") !== false ? 'found' : 'not found');
?>