- stripos: documentation ( source)
<?php
$oggetto = "CONSEGNA: Validazione indirizzo PEC";
$subject = "AVVISO DI MANCATA CONSEGNA: Validazione indirizzo PEC [ca282bf8#25125]";
//$subject = "CONSEGNA: Validazione indirizzo PEC [ca282bf8#25125]";
$position = stripos($subject, 'CONSEGNA: Validazione indirizzo PEC');
if(false === $position || $position !== 0) {
echo "NO";
}