thank so much!, i using code:
Code:
<?php
$display = 'hello word - hello word - hello word';
global $find, $replace;
$find = 'h';
$replace = array('1','2','3','4');
$output = preg_replace_callback("/$find/", create_function(
'$matches',
'global $find, $replace; return $find . array_rand($replace);'
),
$display
);
echo $output;
How to $find is array?
Example:
Code:
h1ello word - h2ello word - h3ello word
to:
Code:
h1ello3 wo2rd - h2ello1 wo3rd - h3ello2 wo1rd