Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Twine: String Manipulation, Leveled Up
Jul 11, 2018 @ 14:19:02

On the Laravel News site there's a post spotlighting an interesting string manipulation library (Twine) and some of its basica features and use.

Twine is a stand-alone PHP 7 package by Chris Kankiewicz for string manipulation and comparison with an expressive fluid syntax.

They provide several code examples showing the package in action:

  • adding padding to the left/right
  • uppercase/lowercase
  • starts with/contains/ends with
  • converting the string to a hash
  • basic string formatting

The package also makes use of a fluent interface, making it easier to stack multiple operations onto a string (like checking to see if a substring equals a value). You can find out more about the package on its GitHub repository.

tagged: string manipulation package library twine tutorial

Link: https://laravel-news.com/twine-string-manipulation-leveled-up


Trending Topics: