Download the PHP package conkal/ztring without Composer

On this page you can find all versions of the php package conkal/ztring. 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 ztring

ztring

Latest Stable Version License Total Downloads Build

A PHP string manipulation library.

Installation

OO and Chaining

The library offers OO method chaining, as seen below:

Conkal\ztring has a __toString() method, which returns the current string when the object is used in a string context, ie: (string) ztring::create('foo') // 'foo'

Implemented Interfaces

Conkal\ztring implements the IteratorAggregate interface, meaning that foreach can be used with an instance of the class:

It implements the Countable interface, enabling the use of count() to retrieve the number of characters in the string:

Furthermore, the ArrayAccess interface has been implemented. As a result, isset() can be used to check if a character at a specific index exists. And since Conkal\ztring is immutable, any call to offsetSet or offsetUnset will throw an exception. offsetGet has been implemented, however, and accepts both positive and negative indexes. Invalid indexes result in an OutOfBoundsException.

Class methods

create(string $str)

Creates a ztring object and assigns string property. $str is cast to a string prior to assignment.

Instance Methods

append(string $string)

Returns a new string with $string appended.

at(int $index)

Returns the character at $index, with indexes starting at 0.

camelcase()

Returns a camelCase version of the string. Trims surrounding spaces, capitalizes letters following digits, spaces, dashes and underscores, and removes spaces, dashes, as well as underscores.

chars()

Returns an array consisting of the characters in the string.

collapseWhitespace()

Trims the string and replaces consecutive whitespace characters with a single space. This includes tabs and newline characters, as well as multibyte whitespace such as the thin space and ideographic space.

endsWith(string $substring [, boolean $caseSensitive = true ])

Returns true if the string ends with $substring, false otherwise. By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

ensureLeft(string $substring)

Ensures that the string begins with $substring. If it doesn't, it's prepended.

ensureRight(string $substring)

Ensures that the string ends with $substring. If it doesn't, it's appended.

firstChar()

Returns the first $n characters of the string.

firstXChars()

Returns the first $n characters of the string.

lastChar()

Returns the last $n characters of the string.

lastXChars()

Returns the last $n characters of the string.

length()

Returns the length of the string. An alias for PHP's mb_strlen() function.

lowerCaseFirst()

Converts the first character of the supplied string to lower case.

prepend(string $string)

Returns a new string starting with $string.

removeLeft(string $substring)

Returns a new string with the prefix $substring removed, if present.

replace(string $search, string $replacement)

Replaces all occurrences of $search in $str by $replacement.

reverse()

Returns a reversed string. A multibyte version of strrev().

random()

Create a random string

slug( [string $separator = '-'])
startsWith(string $substring [, boolean $caseSensitive = true ])

Returns true if the string begins with $substring, false otherwise. By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.

substr(int $start [, int $length ])

Returns the substring beginning at $start with the specified $length. It differs from the mb_substr() function in that providing a $length of null will return the rest of the string, rather than an empty string.

swapCase()

Returns a case swapped version of the string.

titleCase()

Returns a trimmed string with the first letter of each word capitalized.

ascii($languageSpecific)

Returns an ASCII version of the string.

toBoolean()

Returns a boolean representation of the given logical string value. For example, 'true', '1', 'on' and 'yes' will return true. 'false', '0', 'off', and 'no' will return false. In all instances, case is ignored.

toLowerCase()

Converts all characters in the string to lowercase. An alias for PHP's mb_strtolower().

toTitleCase()

Converts the first character of each word in the string to uppercase.

uppercase()

Converts all characters in the string to uppercase. An alias for PHP's mb_strtoupper().

trim([, string $chars])

Returns a string with whitespace removed from the start and end of the string. Supports the removal of unicode whitespace. Accepts an optional string of characters to strip instead of the defaults.

upperCaseFirst()

Converts the first character of the supplied string to upper case.

words()

Returns words as array

sanitize()

Removes all special characters

acronym()

Creates an acronym

number()

return only digits between 0-9

Tests

From the project directory, tests can be ran using phpunit

License

Released under the MIT License - see LICENSE.txt for details.


All versions of ztring with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
ext-mbstring Version *
ext-openssl Version *
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 conkal/ztring contains the following files

Loading the files please wait ....