- preg_match: documentation ( source)
<?php
$strNonNumeric = '?ct=123';
$string = "456";
if (preg_match("/^\?ct\=(\d+\,?)+$|^\?ct\=\d+$/i", $strNonNumeric)) { echo "true";};
if (preg_match('/\b(?:' . $string . ')\b/i', $strNonNumeric)) {echo "whole word";};