in php we have
[PHP]
<?php>
$pattern[0]='/a/i';
$pattern[1]='/b/i';
$replacement[0]='';
$replacement[1]='';
$var = 'Watbe';
echo preg_replace($p attern, $replacement, $var);
?>[/PHP]
using pattern array to replace two match at the same time.
Under is what i know in javascript
[HTML]<script>
var str="aacc";
var rs=str.replace(/a/i,"0");
</script>[/HTML]
Is there any patterns array for us to use like the php one???
[PHP]
<?php>
$pattern[0]='/a/i';
$pattern[1]='/b/i';
$replacement[0]='';
$replacement[1]='';
$var = 'Watbe';
echo preg_replace($p attern, $replacement, $var);
?>[/PHP]
using pattern array to replace two match at the same time.
Under is what i know in javascript
[HTML]<script>
var str="aacc";
var rs=str.replace(/a/i,"0");
</script>[/HTML]
Is there any patterns array for us to use like the php one???
Comment