Giter Club home page Giter Club logo

helpers's Introduction

Helpers

String Helpers

How to use?

First time you must include src/Str.php in your project for use this helper. Coming soon i will add this project with composer. For Example code you can see in example folder.

What i can do?

Here in list.

  1. Strip Quotes
  2. Strip Slashes
  3. Random String
  4. Alternator

Strip Quotes

You can use this helper for string or multiple data with array.

  $data = 'Test String "';
  Str::strip_quotes($data);

Strip Slashes

You can use this helper for string or multiple data with array.

  $data = 'Test String \' ';
  Str::strip_slashes($data);

Random String

You can use this helper for random string. Here in list.

  1. alnum for Alphanumeric
  2. alpha for Alphabet
  3. numeric for Numeric
  4. md5 for MD5
  5. hex for Hex
  6. binary for Binary text
  Str::random(); // Default is alnum
  Str::random(18,'alnum'); //Alnum result
  Str::random(18,'alpha'); //Alpha result
  Str::random(18,'numeric'); //Numeric result
  Str::random(18,'md5'); //MD5 result
  Str::random(18,'hex'); //Hex result
  Str::random(18,'binary'); //Binary result

Alternator

You can use this helper for alternating.

  for ($i = 0; $i < 10; $i++)
      {
        echo Str::alternator('one', 'two', 'three', 'four', 'five');
      }

Reverse Case

You can use this helper to reverse the case of each letter in a string.

   $data = 'tESt stRinG';
   Str::reverse_case($data);
   // Test String

Title Case

You can use this helper for making a string or array of strings title case.

    $data = 'test strinG';
    Str::title_case($data);
    // Test String

Limit

You can use this helper to limit a string or array of strings up to specified length.

    $data = 'test string';
    Str::limit($data, 4);
    // test 

Contains

You can use this helper to check if specific word or key exists in a string.

    $data = 'test string';
    Str::contains($data, 'test');
    // true

helpers's People

Contributors

ppabcd avatar ammarfaizi2 avatar thursdaydan avatar sazanrjb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.