- preg_replace: documentation ( source)
<?php
$constant = 'AUTH_KEY';
echo preg_replace( '#(define\(.*(\'' . $constant . '\'|"' . $constant . '"),(.*))#', '/*Commented by SecuPress*/ /* $0 */', "define('AUTH_KEY', 'd.K7bRKnt/6*}rKMqbuF(yyr5?>WqUBElKrY1#XMdhlnF1K@FoVJ#8>ghm=r^?l<L,');" ) . "\n";