Jump to content
php.lv forumi

preg_replace_callback


DMG

Recommended Posts

Bah, tu nesaprati, ko marrtins saka. Viņš tev saka šādi:

class Size
{
 private $width;
 private $height;
 public __construct($w, $h)
 {
$this->width = $w;
$this->height = $h;
 }
 public function blah($capture)
 {
return checkimgsize2($this->w, $this->h, $capture);
 }
}

preg_replace_callback('/(\[img\])(.+?)(\[\/img\])/i', array(new Size(550, 880), 'blah'), $data);

 

Vai arī lieto to manis doto curry veidu.

Link to comment
Share on other sites

Bubu man tak viss tagad sk un es neko nesūdzos ;) Es iepriekš tikai martinam paskaidroju domu vēl reiz un pajautāju tev vai nevēlies paskaidrot kas notiek tava koda "curry($func)" funkcijā :) Bet ja nevēlies, tad viss ok un thanks par visu.

Link to comment
Share on other sites

×
×
  • Create New...