Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $str = 'z1.z2.z3.z6;
- $z = array();
- $z[0] = '/z1./';
- $z[1] = '/z2./';
- $z[2] = '/z3./';
- $z[3] = '/z6/';
- $replaced = array();
- $replacements[3] = '/[f1]/';
- $replacements[2] = '/[f2]/';
- $replacements[1] = '/[f3]/';
- $replacements[0] = '/[f6]/';
- echo preg_replace($z, $replacements, $str);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement