Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $page = <<< TXT
- CASE "grml"\r\n
- prflidty$ = "Gremlin"\r\n
- prflactn$ = "movebitepnch"\r\n
- IF RND(1) > .2 THEN\r\n
- prflactn$ = prflactn$ + "dggr"\r\n
- END IF\r\n
- prflgpic$ = "grml"\r\n
- prflidty! = 4\r\n
- prflhp! = 25\r\n
- prflstr! = 90\r\n
- prflspd! = 1\r\n
- prflarmr! = 1\r\n
- prflvalu! = 5\r\n
- prflpirc! = 2\r\n
- prfllv! = 1\r\n
- prflhpmax! = 25\r\n
- prflstrmax! = 90\r\n
- TXT;
- echo gen_statsheet($page);
- function gen_statsheet( $page = '' ) {
- $return = '';
- $pattern = '/(?:prfl(?<stat>idty|hp|str|spd|armr|valu|pirc|lv|hpmax|strmax|essmax|essspd)!) = (?<value>[.\d]+)/m';
- while( preg_match_all( $pattern, $page, $matches, PREG_UNMATCHED_AS_NULL ) )
- {
- if( !is_null( $matches[ 'stat' ] ) and !is_null( $matches[ 'value' ] ) )
- {
- $return .= '<p>'. $matches[ 'stat' ]. '='. $matches[ 'value' ]. '</p>';
- }
- }
- return $return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement