Preg_replace bir işlevi çağırmadan Sorun ne zaman

0 Cevap php
$content = "... [gallery=174] ... ";
echo $c = preg_replace('/\[gallery=([0-9]+)\]/',gallery("$1"),$content);
function gallery($id)
{
   mysql_query("select * from `table` where `id` = '$id'");
}

ama $id o $1 anlamak yerine 174 sorguda.

Sebebi nedir? Ve ben bunu nasıl düzeltebilirim?

Çok teşekkürler

0 Cevap