<?php
class bn_en {
public function bnen($val){
$en = array ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$bn = array ( '০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯');
return str_ireplace($bn, $en, $val);
}
public function enbn($val){
$en = array ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$bn = array ( '০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯');
return str_ireplace($en, $bn, $val);
}
}
?>
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<title>বাংলা</title>
</head>
<body>
<?php
// input
$val1='১০';
$val2='২৫';
$bninput = new bn_en();
echo $out = $bninput->bnen($val1)+$bninput->bnen($val2);
echo '<br />';
// output
$bnoutput = new bn_en();
echo $bnoutput->enbn($out);
?>
</body>
</html>
class bn_en {
public function bnen($val){
$en = array ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$bn = array ( '০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯');
return str_ireplace($bn, $en, $val);
}
public function enbn($val){
$en = array ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$bn = array ( '০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯');
return str_ireplace($en, $bn, $val);
}
}
?>
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<title>বাংলা</title>
</head>
<body>
<?php
// input
$val1='১০';
$val2='২৫';
$bninput = new bn_en();
echo $out = $bninput->bnen($val1)+$bninput->bnen($val2);
echo '<br />';
// output
$bnoutput = new bn_en();
echo $bnoutput->enbn($out);
?>
</body>
</html>