Guest User

Untitled

a guest
Oct 20th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.22 KB | None | 0 0
  1. <?php
  2. $x = 'a:1:{s:10:"guest_name"";s:10:""Kelly Gallagher"";}"';
  3.  
  4. $x = preg_replace('/s:([1-9][0-9]*):""/', 's:${1}:"', $x);
  5. $x = preg_replace('/(\w)"";/', '${1}";', $x);
  6. $x = preg_replace('/"$/', '', $x);
  7.  
  8. echo "$x\n";
Add Comment
Please, Sign In to add comment