Guest User

Untitled

a guest
Nov 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2. //error_reporting( 0 );
  3.  
  4. class string
  5. {
  6. function lenght( $string )
  7. {
  8. if (!$string) { exit ( "INVALID string::lenght use, first arg missing/invalid" ); }
  9. return strlen( $string );
  10. }
  11.  
  12. function find( $where, $what )
  13. {
  14. if (!$where) { exit ( "INVALID string::find use, first arg missing/invalid" ); }
  15. if (!$what) { exit ( "INVALID string::find use, first arg missing/invalid" ); }
  16.  
  17. $result = strstr( $where, $what, false );
  18. if ($result)
  19. {
  20. return true;
  21. }
  22.  
  23. return false;
  24. }
  25.  
  26. function explode( $what, $string )
  27. {
  28. if (!$what) { exit( "INVALID string::explode use, first argument missing/invalid" ); }
  29. if (!$string) { exit( "INVALID string::explode use, second argument missing/invalid" ); }
  30.  
  31. return explode( $what, $string );
  32. }
  33.  
  34. function lower( $string )
  35. {
  36. if (!$string) { exit ( "INVALID string::lower use, first arg missing/invalid" ); }
  37. return strtolower( $string );
  38. }
  39.  
  40. function upper( $string )
  41. {
  42. if (!$string) { exit ( "INVALID string::upper use, first arg missing/invalid" ); }
  43. return strtoupper( $string );
  44. }
  45.  
  46. function check( $string, $what, $pos1, $pos2 )
  47. {
  48. if (!$string) { exit ( "INVALID string::check use, first arg missing/invalid" ); }
  49. if (!$what) { exit ( "INVALID string::check use, second arg missing/invalid" ); }
  50.  
  51. if ( substr( $string, intval($pos1), intval($pos2) ) == $what )
  52. {
  53. return true;
  54. }
  55.  
  56. return false;
  57. }
  58. }
  59.  
  60. echo string::check( "STEAM_0:0:254353523", "STEAM_", 0, 6);
  61. ?>
Add Comment
Please, Sign In to add comment