Download the PHP package jasonlam604/stringizer without Composer

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

Stringizer

Stringizer is a PHP string manipulation library with support for method chaining and multibyte handling

Latest Stable Version Total Downloads Monthly Downloads Build Status Coverage Status License: MIT

Basic Functions

String Functions

Overview

Stringizer is a string library made up of existing PHP multibyte-string functions and a variety of string manipulation solutions found on Stackoverflow.com. The intent is to save you time looking up string maninpulation solutions yourself and provide the convience of method chaining. Awarded the Innovation Award in June 2016 from PHPClasses.org.

PSR Compliance and Code Quality:

Key Highlights

Version

Latest Stable Version

Installation

It's recommended that you use Composer to install Stringizer.

Manual install with composer

Using the composer.json file

This will install Stringizer and all required dependencies. Stringizer requires PHP 5.6.0 or newer.

Usage

Sample usage:

Tests

To execute the test suite, you'll need phpunit.

Submit Issues

Feel free to open any Issues, Bugs or suggestions!

Contributing

Accepting Pull-Requests!

Credits

License

The Stringizer is licensed under the MIT license. See License File for more information.

String Functions

base64Decode

Bae64 decode string

base64Encode

Base64 Encode String

between

Extracts a string between left and right strings.

camelize

Removes any underscores or dashes and converts a string into camel case.

camelToSnake

Converts Camel case to Snake Case.

charAt

Obtain character at specific position in a string where the first position is consider 0.

chars

Return the given string as an array where each index contains a character.

chompLeft

Deprecated - Removes prefix from start of string.

chompRight

Deprecated - Removes suffix from start of string.

chopLeft

Removes prefix from start of string.

chopRight

Removes suffix from start of string.

collapseWhitespace

Remove extra whitespace, leave only one whitespace between characters where there is more then one whitespace value.

concat

Combine string values.

Combine at end of the string.

Combine at the beginning of the string by passing in the boolean value true in the optional second parameter.

contains

Search for string within another string, return true if found else return false

containsCount

Count the number of string occurrences

dasherize

Break up a camelize string and seperate with dashes

delete

Delete runes in str matching the pattern, similiar to the delete string feature in Ruby

endsWith

Checks if a string ends with the given suffix.

ensureLeft

Ensure string starts with prefix

ensureRight

Ensure string ends with suffix

first

Grabs a section from the beginning of the string, the size of the section is determine by the given indicated value.

hashCode

Determine the hashcode of a string, algorithm matches the hashCode method available in a Java String class

hasLowercase

Checks if value is contains only lowercase values.

hasUppercase

Checks if value is contains only uppercase values.

indexOf

Finds position of first occurrence of a string within another.

If no match is found boolean false is returned.

There is a second optional parameter, position offset where to begin the search where left most value is index 0.

MultiByte

Case In-sensitive

isAscii

Checks if value contains valid ASCII values only. Optional parameter to allow only printable characters

isAlpha

Checks if value is contains alpha values only.

isAlphaNumeric

Checks if value is contains alphanumeric values only

isAlphaNumericSpace

Checks if value is contains alphanumeric values only including space(s).

isAlphaNumericSpaceDash

Checks if value is contains alphanumeric values only including space(s) and dash(es).

isBase64

Checks if value is a valid Base64 string

isBlank

Checks if value is blank (alias to isEmpty), if string contains whitespace only it is considered empty.

isDate

Checks if value is valid date based on the PHP function strtotime.

Requirement, default timezone must be set first

isDecimal

Checks if value is contains decimal value, whole numbers are considered valid.

isEmail

Checks if value is a valid email.

isEmpty

Checks if value is empty, if string contains whitespace only it is considered empty.

isHash

Checks if value is empty, if string contains whitespace only it is considered empty.

isHexColor

Checks if value is valid Hex Color.

isHexDecimal

Checks if value is hexdecimal.

isIsbn10

Determines if value is valid ISBN10

isIsbn13

Determines if value is valid ISBN13

isIPv4

Checks if value is a valid IP, IPv4.

isIPv6

Checks if value is a valid IP, IPv6.

isJson

Determines if value is valid JSON

isNumber

Checks if value is a whole number, can be a negative number but can not be a decimal number.

isMultiByte

Checks if value is MultiByte

isLatitude

Checks if value is valid Latitude value

isLongitude

Checks if value is valid Longitude value

isRgbColor

Checks if value is valid RGB Color

isSemver

Checks if value is a valid semver format, see http://semver.org/

isUrl

Checks if value is contains a valid URL

join

Concatenates the elements of a to create a single string. The separator string sep is placed between elements in the resulting string. If there is an existing value it is over-written. Default seperator is a comma, if no separator is required then use a blank string.

Uses default separator a comma

Uses a pipe as the separator

No separator, use of a blank strinng

last

Grabs a section from the end of the string, the size of the section is determine by the given indicated value.

lastIndexOf

Finds position of last occurrence of a string within another

If no match is found boolean false is returned.

There is a second optional parameter, position offset where to begin the search where left most value is index 0.

MultiByte

Case In-sensitive

length

Find the length of the string

Multibyte

lineCount

Count the number of lines based line feed, \n.

lowercase

Ensure the string is entirely lower case

lowercaseFirst

First letter of the string is lower cased

padBoth

Pad string on both sides with indicated value

Padding with an even amount

Padding with an odd amount, the extra character is addded to the end of the string

padLeft

Pad string on left side with indicated string value and number of times to pad with

padRight

Pad string on right side with indicated string value and number of times to pad with

randomAlpha

Generate a random alpha value, default length of 10 characters.

randomNumeric

Generate a random string value containing only numeric values, default length of 10 characters. It is important to note this is a string value because otherwise if a value with leading zeros such as 0123456789 would then be 123456789 as type int; but, then would not be length of 10 characters (or the desired indicated expected length)

randomAlphaNumeric

Generate a random alphanumeric value, default length of 10 characters.

repeat

Returns a string repeated n times.

replaceAccents

Replace characters with accents with the same character without accents.

removeAscii

Remove non Ascii characters

removeWhitespace

Remove any whitespace from the string (before, after and any in between)

replace

Match and replace string(s)

Multiple replace

No Match NOT Case-Insensitive

Match Case-Insensitive

MultiByte

reverse

MultiByte

sentenceCount

Count the number of sentences based sentences ending with one the following: . ! or ?

split

Explode string into an array default delimiter is comma

startsWith

Checks if a string starts with the specified suffix.

stripPunctuation

Remove all of the punctuation

stripTags

Remove HTML and PHP tags from a string

Optional second paramter to ignore tags (tags not to be to removed)

substring

Find a portion of a string based on postioning (index position in the string) and length of the portion

MultiByte

swapCase

Swap the case of each character.

toBoolean

Converts a logical truth string to boolean.

trim

Remove whitespace both right and left side of the string

trimLeft

Remove whitespace left of the string

trimRight

Remove whitespace right of the string

truncate

Shorten right side of string by the specified indicated amount

truncateMatch

Shorten string left or right side if given substring is match

Case In-sensitive

uppercase

Ensure entire string is uppercase

uppercaseWords

Ensure entire string is uppercase

width

Find the width of the string this is different then length for multibyte strings

wordCount

Count the number of words.

Basic Functions

setstring

Setting the string you want to apply string manipulations on, this will set the orginal value as well.

php $s = new Stringizer("dummy-value"); $s->getString(); php $s = new Stringizer("dummy-value"); $s->getStringOriginal(); php $s = new Stringizer("dummy-value"); echo ($s); // this will output current state, defaults to using the PHP built __toString method php $s = new Stringizer("dummy-value"); $s->setEncoding("UTF-8"); $s->getEncoding(); // UTF-8 php $s = new Stringizer("dummy-value"); $s->getEncoding(); // Outputs your default encoding based mb_internal_encoding


All versions of stringizer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
cocur/slugify Version 3.2.*
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 jasonlam604/stringizer contains the following files

Loading the files please wait ....