PHP Tutorial String
To Array
- Break a string into an array and return an array except for the last -limit elements() in PHP
- Break a string into an array and return an array with a maximum of limit element(s) in PHP
- Break a string into an array and return only one element in PHP
- Break a string into an array in PHP
Compare
- Calculate the Levenshtein distance between two strings in PHP
- Calculate the metaphone key of " World " : in PHP
- Calculate the similarity between two strings and return the matching characters in PHP
- Calculate the similarity between two strings in percent: in PHP
- Calculate the soundex key of " Hello " in PHP
- Check if the password contains only numbers in PHP
- Check various return values from strcmp in PHP
- Compare Different return values from strcasecmp in PHP
- Compare strings with locale information in PHP
- Compare two strings (case-insensitive): in PHP
- Compare two strings case-sensitive in PHP
- Compare two strings in PHP
- Compare two strings using a " natural " algorithm (case-insensitive): in PHP
- Compare two strings using a " natural " algorithm (case-sensitive) in PHP
- Compare two sub strings (case-insensitive) in PHP
- Compare two sub strings (case-sensitive) in PHP
Convert
- Convert a string from one character-set to another in PHP
- Convert all characters to lowercase in PHP
- Convert all characters to uppercase in PHP
- Convert the decimal values 43 and 61 to add the ASCII Characters: + and = in PHP
- Convert the first character of " Hello " to lowercase in PHP
- Convert the first character of each word to uppercase in PHP
- Convert the first character of " hello " to uppercase in PHP
- Convert the octal value 046 to add the ASCII Character in PHP
- Create an array where key is word position in the string, and value is the actual word in PHP
- Create an array with the words from the string in PHP
Count
- Count char frequency in PHP
- Count the number of times " world " occurs in the string in PHP
- Count the number of words found in the string " Hello World! " in PHP
Encode Decode
- Decode a quoted-printable string to an 8-bit ASCII string in PHP
- Decode a uuencoded string: in PHP
- Decode data encoded with MIME base64 in PHP
- Encode a string and then decode it in PHP
- Encode a string and then decode it using the uuencode algorithm in PHP
- Encode a string using the uuencode algorithm in PHP
- Encode and decode a string in PHP
- Encode data with MIME base64 in PHP
- Display dot if the string is too long in PHP
- Format value to a string with sprintf in PHP
HereDoc
- Embed variable in hereDoc and string in PHP
- Print out heredoc in PHP
Pad
- Emulate str_pad() with while loop and strlen function in PHP
- Pad string from both side in PHP
- Pad to both sides of the string: in PHP
- Pad to the left side of the string: in PHP
- Pad to the right side of the string, to a new length of 20 characters in PHP
Search
- Find the first occurrence of " world " inside " Hello world! " and return the rest of the string in PHP
- Find the first occurrence of " world " inside " Hello world! " case-insensitive, and return the rest of the string in PHP
- Find the position of the first occurrence of " CSS " inside the case-insensitive string in PHP
- Find the position of the first occurrence of " CSS " inside the string in PHP
- Find the position of the last occurrence of " CSS " inside the string in PHP
- Match a filename or string against the specified pattern in PHP
- Search a string, and return all characters from this position to the end of the string in PHP
- Search a string for ASCII value of " e " (101) and return all characters from this position to string end in PHP
- Search a string for the ASCII value of " o " and return the rest of the string: in PHP
- Search a string for the ASCII value of " o " case-insensitive, and return the rest of the string in PHP
- Search a string for the characters, return the rest of the string in PHP
- Search for a specified character or text within a string in PHP
Operation
- Get information about characters used in a string in PHP
- Get the part of the string before the first occurence of " world " in PHP
- Print the number of characters found in " Hello world! " before the character " w " in PHP
- Randomly shuffle all characters of a string in PHP
- Reference a single character from a string in PHP
- Return characters from different ASCII values in PHP
- Return the ASCII value of " h " in PHP
- Return the number of characters found in the string " Hello world! " that contains the characters " kHlleo " in PHP
- Return the part of the string before the first occurence of " world " Case-insensitive in PHP
- Tokenize a string by :,| in PHP
- Use while loop to control the strpos in PHP
- Using all parameters: in PHP
- Wrap a string into new lines in PHP
Substring
- Get sub from the string start in PHP
- Get value from a line using strpos and substr in PHP
Length
- Get the length of a string, in characters in PHP
- Return the length of the string " Hello " : in PHP
- Use the length parameter on metaphone function in PHP
- Using the length parameter: in PHP
- Wrap a string into new lines when it reaches a specific length in PHP
Insert
- Insert " Hello " at the beginning of " world " in PHP
- Insert line breaks where newlines (\n) occur in the string in PHP
- Insert line breaks where newlines (\n) occur, using the xhtml parameter in PHP
Remove
- Remove characters from both sides of a string in PHP
- Remove characters from the left side of a string in PHP
- Remove characters from the right end of a string in PHP
- Remove newlines (\n) from both sides of the string in PHP
- Remove newlines (\n) from the left side of a string in PHP
- Remove newlines (\n) from the right end of a string in PHP
- Remove whitespaces from both sides of a string in PHP
- Remove whitespaces from the left side of a string in PHP
- Remove whitespaces from the right side of a string in PHP
Repeat
- Repeat the string a number of times in PHP
Replace
- Replace " Hello " with " world " : in PHP
- Replace at the 5th position from the end of the string in PHP
- Replace at the 6th position in the string in PHP
- Replace multiple strings at once. Replace " AAA " in each string with " BBB " in PHP
- Replace the characters " WORLD " (case-insensitive) in the string " Hello world! " with " XML " in PHP
- Replace the characters " ia " in the string with " eo " in PHP
- Replace the characters " world " in the string " Hello world! " in PHP
- Replace the string with value in associative array in PHP
- Use str_replace() with an array and a count variable in PHP
- Use str_replace() with less elements in replace than find in PHP
Reverse
- Reverse the string " Hello World! " in PHP
Sort
- Sort with natural algorithm (strnatcmp) and computer string sorting algorithms (strcmp) in PHP
- Sort with natural algorithm (strnatcmp) and default sorting algorithms (strcmp) in PHP
Split
- Split string one by one in PHP
- Split the string " Hello " into an array in PHP
- Split the string after each character and add a " . " after each split in PHP
- Split the string after each sixth character and add a " ### " after each split in PHP
Strip
- Strip the string from HTML tags, but allow bold tags in PHP
- Strip the string from HTML tags in PHP