Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //error_reporting( 0 );
- class string
- {
- function lenght( $string )
- {
- if (!$string) { exit ( "INVALID string::lenght use, first arg missing/invalid" ); }
- return strlen( $string );
- }
- function find( $where, $what )
- {
- if (!$where) { exit ( "INVALID string::find use, first arg missing/invalid" ); }
- if (!$what) { exit ( "INVALID string::find use, first arg missing/invalid" ); }
- $result = strstr( $where, $what, false );
- if ($result)
- {
- return true;
- }
- return false;
- }
- function explode( $what, $string )
- {
- if (!$what) { exit( "INVALID string::explode use, first argument missing/invalid" ); }
- if (!$string) { exit( "INVALID string::explode use, second argument missing/invalid" ); }
- return explode( $what, $string );
- }
- function lower( $string )
- {
- if (!$string) { exit ( "INVALID string::lower use, first arg missing/invalid" ); }
- return strtolower( $string );
- }
- function upper( $string )
- {
- if (!$string) { exit ( "INVALID string::upper use, first arg missing/invalid" ); }
- return strtoupper( $string );
- }
- function check( $string, $what, $pos1, $pos2 )
- {
- if (!$string) { exit ( "INVALID string::check use, first arg missing/invalid" ); }
- if (!$what) { exit ( "INVALID string::check use, second arg missing/invalid" ); }
- if ( substr( $string, intval($pos1), intval($pos2) ) == $what )
- {
- return true;
- }
- return false;
- }
- }
- echo string::check( "STEAM_0:0:254353523", "STEAM_", 0, 6);
- ?>
Add Comment
Please, Sign In to add comment