This is a discussion on string functions and manipulations in php within the PHP Programming forums, part of the Web Development category; Let us discuss about strlen() strlen - It is used to return the length of the string that is passed as ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Let us discuss about strlen() strlen - It is used to return the length of the string that is passed as an argument. Syntax: strlen(stringname); Example: Code: $vString="Discuss web"; echo strlen($vString); Output: 11 |
| Sponsored Links |
| |||
| str_word_count() The str_word_count() function counts the number of words in a string. Syntax str_word_count(string,return,char) Parameters are string = Specifies the string to check and it is Required field. return = Specifies the return value of the str_word_count() function and Optional. Possible values: 0 - Default. Returns the number of words found 1 - Returns an array with the words from the string 2 - Returns an array where the key is the position of the word in the string, and value is the actual word char = Specifies special characters to be considered as words and it is Optional field. Note: This parameter was added in PHP 5.1 PHP Code: 2 Thanks
__________________ K K Venkata Charya Success is easy to get but difficult to retain |
| |||
| strtok() The strtok() function splits a string into smaller strings. Syntax strtok(string,split) Parameters string = Specifies the string to split and it is Required field. split = Specifies one or more split characters and it is Required field. strtok() splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token. That is, if you have a string like "This is an example string" you could tokenize this string into its individual words by using the space character as the token. PHP Code: string(0) "" string(9) "something" Thanks
__________________ K K Venkata Charya Success is easy to get but difficult to retain |
| |||
| Why do you need to encode HTML contents? Maybe you'd like to encode a string, or a number of strings maybe? If so, there are thousand of algorythms to achieve this. Try PHP: Manual Quick Reference |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compare a string with String Array. | oxygen | C# Programming | 5 | 12-28-2007 11:18 PM |
| What is diffrenece between string.compare and string.compareordinal | shaalini | ASP and ASP.NET Programming | 3 | 12-28-2007 10:46 PM |
| What are Virtual Functions? How to implement virtual functions in "C"? | Sabari | C and C++ Programming | 4 | 09-10-2007 11:35 PM |
| TSL functions used for moving the pointer to that text string in winrunner | senthilkannan | Testing Tools | 0 | 07-30-2007 03:08 AM |
| How to split a string by using a string usually in the c# dotnet... | Archer | C# Programming | 1 | 07-25-2007 03:26 AM |