Download the PHP package laraplus/string without Composer

On this page you can find all versions of the php package laraplus/string. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package string

Laraplus/String

This package provides a fluent easy-to-use interface for string manipulation. It integrates with Illuminate\Support to enable a fluent syntax even when dealing with multiple results. All methods are UTF-8 friendly.

Installation

To install this package, simply require it using composer:

Example usage

With this package you can avoid ugly nested str_* functions and never ending needle-haystack problems:

If you have a slug "my-blog-title-4" and you need to find the index "4", you can simply write:

Lets say you have some custom "colon separated" multi line string that you need to parse:

Full reference

Initialization

You can initialize the StringBuffer object directly or by using the str helper function:

Chaining

When the result of a method call is a string, it is automatically wrapped in a new StringBuffer instance, so that the method calls can be chained.

If you need to unwrap the object, you can do that by calling the get() method or simply cast it to string.

When a method returns an array it is automatically wrapped in a Collection object, which enables further chaining:

For a full reference of available collection methods, see the Laravel documentation: http://laravel.com/docs/5.1/collections#available-methods

Available methods

ucfirst()

Capitalize the first letter of the string.

lcfirst()

Lowercase the first letter of the string.

startsWith($needles)

Determine if the string starts with a given substring.

endsWith($needles)

Determine if the string ends with a given substring.

contains($needles)

Determine if the string contains a given substring.

equals($needles)

Determine if the string equals the given input in a constant time comparison.

matches($pattern)

Determine if the string matches a given pattern.

explode($delimiters)

Split the string with given delimiter(s).

indexOf($needle, $offset = 0)

Find the first occurrence of a given needle in the string, starting at the provided offset.

lastIndexOf($needle, $offset = 0)

Find the last occurrence of a given needle in the string, starting at the provided offset.

replace($search, $replace, &$count = 0)

Replace all occurrences of the search string with the replacement string.

substring($start, $length = null)

Returns the portion of string specified by the start and length parameters

toAscii()

Transliterate a UTF-8 value to ASCII.

toCamel()

Convert a value to camel case.

toSnake()

Convert a value to snake case.

toStudly()

Convert a value to studly case.

toTitle()

Convert a value to title case.

toSlug()

Convert a value to title case.

toUpper()

Convert the given string to upper-case.

toLower()

Convert the given string to lower-case.

toSingular()

Get the singular form of an English word.

toPlural()

Get the plural form of an English word.

length()

Return the length of the given string.

words($ignore = '?!;:,.')

Return a Collection of individual words in the string ignoring the given characters.

lines()

Return a collection of individual lines in the string.

prepend($string)

Prepend a given input to the string.

append($string)

Append a given input to the string.

trim($chars = null)

Trim given characters from both ends of the string. If no characters are provided, all white space is trimmed.

ltrim($chars = null)

Similar to trim(), but only trims characters from the left side.

rtrim($chars = null)

Similar to trim(), but only trims characters from the right side.

limit($limit = 100, $end = '...')

Limit the number of characters in the string.

limitWords($limit = 100, $end = '...')

Limit the number of words in the string.

wordAt($index)

Return the word at the given index.

tree($open = '{', $close = '}')

Parse a tree structure defined by the given delimiters.

Using offsets

Since the StringBuffer class implements the ArrayAccess interface, you can also use all of the usual offset goodies:


All versions of string with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
illuminate/support Version ~5.1|~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laraplus/string contains the following files

Loading the files please wait ....