I use this line to parse "[ node:478 ]":
$preg = array(
...
'#\[node:(\d+)]#si' => nid_to_link('\\1'),
...
)
which calls this function:
function nid_to_link($nid) {
$output = "nid: $nid";
$output .= " intval: ";
$output .= intval($nid);
return $output;
}
The output is:
nid: 478 intval: 0
Anybody know why I am unable to cast nid to an int? I've tried various other methods including casting with (int), (integer), adding 0, etc. Any advice is most appreciated.
Resolved.