Advertisement
metalx1000

PHP - CUT sting

Jan 27th, 2012
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php
  2. // Example 1
  3. $pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
  4. $pieces = explode(" ", $pizza);
  5. echo $pieces[0]; // piece1
  6. echo $pieces[1]; // piece2
  7.  
  8. // Example 2
  9. $data = "foo:*:1023:1000::/home/foo:/bin/sh";
  10. list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
  11. echo $user; // foo
  12. echo $pass; // *
  13.  
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement