Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. preg_match('/(.*)s(([^()]+))$/', 'AK-47 | Красная линия (Factory New)', $matches);
  2. print_r($matches);
  3.  
  4. $result = array_map(function($a){
  5. return trim($a, ' )');
  6. }, preg_split('/(/', 'AK-47 | Красная линия (Factory New)', -1, PREG_SPLIT_NO_EMPTY));
  7. print_r($result);
  8.  
  9. $result = array_map(function($a){
  10. return trim($a, ' ()');
  11. }, explode('(', 'AK-47 | Красная линия (Factory New)'));
  12. print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement