Search the Community
Showing results for tags 'element'.
-
Folks, What is an "Element" in php ? I came across the word when researching on the php's "Count" function: https://www.tutorialspoint.com/php/php_function_count.htm These are not useful as they talk about "element in array" etc.: http://php.net/manual-lookup.php?pattern=element&scope=quickref https://www.google.com/search?q=what+is+an+element+in+php+%3F&oq=what+is+an+element+in+php+%3F&aqs=chrome..69i57j69i64.5238j0j7&sourceid=chrome&ie=UTF-8 Let's not talk about "element in any array". Let's just talk about "element" itself. What is the definition of an "element" in php ? And so, to newbies, how can you describe an "Element" in the layman's language without resorting to complex or advanced stuffs ? I'd like to see a few examples of an element in php with very simple & basic coding that is easily understandable to all beginners. I'm sure future newbies would appreciate your hard work! I am sure "elements" not only exist in "arrays" but other stuffs in php too. So, how-about a few examples on these other stuffs too regarding their elements ? Let me tell you why I prefer examples of an element without involving the array. Here: https://www.tutorialspoint.com/php/php_function_count.htm It says: Return Value It returns the number of elements in an array. Example Try out following example − <?php $a[0] = 1; $a[1] = 3; $a[2] = 5; $result = count($a); print($result); ?> This will produce the following result − 3 I don't see any elements in that example. I see things in this format: $variable name[array number] = array value; Where is the so-called "element" involved in any of this ? Which part is the "element" ? Which part of the "equation" ? Get a beginner's point of view ? These tutorials are not easy to understand. Thanks!
