Tak špatně taky tohle by už mělo být správně, ale nemění to ve stringu, stále zůstává tag a netuším proč...
<?php
require 'admin/const.php';
require 'admin/db.php';
function post_cnt($html){
$gallerySQL=mysql_query("SELECT * FROM gallery");
while($galleryRES=mysql_fetch_array($gallerySQL)):
$galleryHTML="Galerie ".$galleryRES["name_of_gallery"];
$result = str_replace("[GALLERY=".$galleryRES['id_gallery']."]", $galleryHTML, $html);
endwhile;
return $result;
}
$tst="Testovací string [GALLERY=10] něco";
echo post_cnt($tst);
?>