Download the PHP package kzykhys/text without Composer

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

Text - Simple 1 Class Text Manipulation Library

Latest Stable Version Build Status Coverage Status

Do you remember PHP's string functions? If not, just wrap you text with Text! It will save a minute on your coding.

Text is extracted from kzykhys/Ciconia. this is used for markdown processing.

Installation

Modify your composer.json and run php composer.phar update

Requirements

PHP5.4+

Get Started

Text acts like a string

Text can also be called statically

Manipulation methods are chainable:

Special note for replace()

If the second argument is callable, callback takes at least one parameter. The whole match being first, and matched subpatterns. All parameters are Text instance.

API

Manipulation (Chainable)

Method Description
create($text) Create a new Text instance.
append($text) Append the string.
prepend($text) Prepend the string.
wrap($start, [$end]) Surround text with given string.
lower() Make a string lowercase.
upper() Make a string uppercase.
trim([$charList]) Strip whitespace (or other characters) from the beginning and end of a string.
rtrim([$charList]) Strip whitespace (or other characters) from the end of a string.
ltrim([$charList]) Strip whitespace (or other characters) from the beginning of a string.
escapeHtml([$option]) Convert special characters to HTML entities.
replace($pattern, $replacement) Perform a regular expression search and replace. If $replacement is the callable, a callback that will be called and passed an array of matched elements in the subject string.
replaceString($search, $replace) Replace all occurrences of the search string with the replacement string.
indent([$spaces]) Add one level of line-leading spaces.
outdent([$spaces]) Remove one level of line-leading tabs or spaces.
detab([$spaces]) Convert tabs to spaces.
eachLine($callback) Apply a user function to every line of the string.

Test

Method Description
isEmpty() Determine whether a variable is empty
isNumeric() Finds whether a variable is a number or a numeric string
match($pattern, [&$matches]) Perform a regular expression match

Miscellaneous

Method Description
split($pattern, [$flags]) Split string by a regular expression
lines([$pattern]) Split string by a line break
chars() Convert a string to an array
length() Gets the length of a string
countLines() Gets the number of lines
indexOf($needle, [$offset]) Find the position of the first occurrence of a substring in a string

Filesystem

Method Description
save($path) Write a string to a file

License

The MIT License

Author

Kazuyuki Hayashi (@kzykhys)


All versions of text with dependencies

PHP Build Version
Package Version
No informations.
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 kzykhys/text contains the following files

Loading the files please wait ....