paste.xcode.ro » ~/paste/1036

  1. <?php
  2.  
  3. $str = '<form action="/dk?st.cmd=altGroupMain&amp;st.groupId=51746804793453&amp;_prevCmd=altGroupMain&amp;bk=AltGroupEditMediaTopicForm&amp;STKN=iGy73YqwmcSF0VK7m8Di2gvbp7M%2ByrXM&amp;tkn=8504" method="post">';
  4.  
  5. preg_match( '/AltGroupEditMediaTopicForm&amp;STKN=([^;]+);tkn=([^"]+)/', $str, $rets );
  6.  
  7. print_r( $rets );
  8.  
  9. ?>
  10.  
  11.  
  12. OUTPUT:
  13.  
  14. ]# php regex.php
  15. Array
  16. (
  17.     [0] => AltGroupEditMediaTopicForm&amp;STKN=iGy73YqwmcSF0VK7m8Di2gvbp7M%2ByrXM&amp;tkn=8504
  18.     [1] => iGy73YqwmcSF0VK7m8Di2gvbp7M%2ByrXM&amp
  19.     [2] => 8504
  20. )
  21.  
Language: php
Posted by xxx at 03 Sep 2013, 04:48:17 Europe/Bucharest