In this i thought that it is better to use do while.., do is for calculating the input emails form form, and while for displaying.. While is the best but check what i done now...! <?php $email=$_POST['mal']; $emailnumber = 2; $st = preg_split('/\s*,\s*/', $email); for ($i=0; $i<=$emailnumber; $i++) { print_r("$st[$i]"); echo "<br>"; } ?> PHP: if $_POST['mal'] having 1000 emails separating with comma ( , ) just like , how can i write for loop.., i mean at $i<=$emailnumber ($i<=2) i have given for example 2.., it is working but what if i give 1000, dont say $i<=1000 hahah,.., just i am saying for example.. 1000, How can i calculate $emailnumber number from the input form.., i have one idea that.., first i have to check how many @ are there in that $_POST['mal'] then we can assign the $emailnumber, but i dont know how to do that as i am not expert.., i am just learner.. Thanks for your help....!
<?php $email = $_POST['mal']; $emailnumber = substr_count($email, '@'); ?> PHP: or: <?php $email = $_POST['mal']; $emailnumber = sizeof(explode(',', $email)); ?> PHP: But if your wanting to be more accurate, you could use preg_match() with a regex to validate an email and then count the matches to give the $emailnumber.
Ohh k k., thanks a lot friend.., i want to say this.., the answers from danx10 are always almost perfect.....! i am not blaming others.., just saying ..., Thanks dear.! and thanks to allllll