View Single Post
  #2 (permalink)  
Old 05-10-2008, 02:00 AM
saravanan saravanan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 181
saravanan is on a distinguished road
Default Re: PHP String Functions With Examples

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:
<?
$vInput
="addf";
$vStr=str_split($vInput);
for(
$i=0;$i<count($vStr);$i++)
{
    if(
$vStr[i]=='d')
     {
         
$vA++;
      }
}
echo 
$vA++;
?>

output;
2
Reply With Quote