I try preg_replace_callback_array for math bbcode. Its returning as plain text while i require calculated result
<?php
$kode = array (
"/\[math\]([0-9+\-\/*\)\(]+?)\[\/math\]/" =>
function($matches) {$value = "$matches[1]"; return $value;},
);
$body = 'my result is [math]100-3[/math]';
echo preg_replace_callback_array($kode,$body);
?>
Bbcode work fine but doesn’t return calculation
If i use [math]100+10[/math]
it return 100+10
but i want to get 110
here