This is a discussion on PHP String Functions With Examples within the PHP Programming forums, part of the Web Development category; hai i have read PHP string functions. how can use these functions on right place with right functions give me ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| hai i have read PHP string functions. how can use these functions on right place with right functions give me some examples Thanks
__________________ Thanks & Regards, Jegan CBK "We will either find a way, or make one!” |
| Sponsored Links |
| |||
| str_split function The str_split() function splits a string into an array. to used to check give character comes or not in that input string PHP Code: output; 2 |
| |||
| The explode() function breaks a string into an array. example: PHP Code: Array ( [0] => Hello [1] => world. [2] => It's [3] => a [4] => beautiful [5] => day. ) |
| |||
| The implode() function returns a string from the elements of an array. <?php $arr = array('Hello','World!','Beautiful','Day!'); echo implode(" ",$arr); ?> The output of the code above will be: Hello World! Beautiful Day! |
| |||
| The count_chars() function returns how many times an ASCII character occurs within a string and returns the information. Syntax count_chars(string,mode) Example 1 In this example we will use count_char() with mode 1 to check the string. Mode 1 will return an array with the ASCII value as key and how many times it occurred as value (e.g. in the example below, the ASCII value for the letter "l" is 108, and it occurs three times): <?php $str = "Hello World!"; print_r(count_chars($str,1)); ?> The output of the code above will be: Array ( [32] => 1 [33] => 1 [72] => 1 [87] => 1 [100] => 1 [101] => 1 [108] => 3 [111] => 2 [114] => 1 )
__________________ Thanks Regards Sureshbabu Harikrishnan ![]() +91 9884320017 |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| string functions and manipulations in php | Anand | PHP Programming | 84 | 12-04-2007 12:17 AM |
| PHP functions and examples | varghese | PHP Programming | 7 | 11-19-2007 06:02 AM |
| HTML and CSS examples | varghese | HTML, CSS and Javascript Coding Techniques | 0 | 11-09-2007 03:33 AM |
| Examples in SQL/MYSQL | varghese | Database Support | 0 | 11-09-2007 03:10 AM |
| TSL functions used for moving the pointer to that text string in winrunner | senthilkannan | Testing Tools | 0 | 07-30-2007 02:08 AM |