Click here to Skip to main content
15,913,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to store iterating array values into session.I want to store that echo statement into session.How can i put.
PHP
 $str=explode(',',$_POST['search']);
               $sentence=$_POST['comment1']."".$_POST['comment2']."".$_POST['comment3'];
               for($i=0;$i<sizeof($str);$i++){>
               echo "$str[$i]:".substr_count($sentence,$str[$i])."\t";
}


[Edit] Formatted code [/EDIT]
Posted
Updated 24-Apr-12 2:10am
v2

1 solution

Store it into the session. Try something like this:
$_SESSION[$str[$i]] = substr_count($sentence, $str[$i])."\t";


Good luck!
 
Share this answer
 
Comments
DeepthiTanguturi 24-Apr-12 8:08am    
How can i get that values

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900