what is the diffrence between for and foreach?
Answer Posted / anuradha
foreach sort of asbtracts away some of the complexity and is
usually easier. I use this whenever I don't need to know the
numeral index of the array or $key => $value won't provide
me with it.
for is the older C style where you must first perform a
count() so you know how many iterations the loop requires.
It is useful when you need to know the index, or to count
backwards or step through in different groups.
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Which cryptographic functions in php returns the longest hash value?
Why framework is used in php?
How to access a specific character in a string using php?
Tell me how can we connect to a mysql database from a php script?
What is global array in php?
What is stdclass in php?
What is the string concatenation operator in php?
How long is session timeout?
What is form validation in php?
What is the difference between single quoted string and double quoted string?
Hi this is amul jani here, i complied my graduation in B.com stream.. but as career i looking for PHP language.. to get shape my career. so is that possible to enter in IT world.. for me how much scope of develop my career in this field.. amul jani
Explain about switch statement in PHP?
What is symfony php?
Write the statements that are used to connect php with mysql
What is the use of $_request variable?