Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2. $str = 'z1.z2.z3.z6;
  3. $z = array();
  4.  
  5. $z[0] = '/z1./';
  6. $z[1] = '/z2./';
  7. $z[2] = '/z3./';
  8. $z[3] = '/z6/';
  9.  
  10. $replaced = array();
  11.  
  12. $replacements[3] = '/[f1]/';
  13. $replacements[2] = '/[f2]/';
  14. $replacements[1] = '/[f3]/';
  15. $replacements[0] = '/[f6]/';
  16.  
  17. echo preg_replace($z, $replacements, $str);
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement