Join WhatsApp ChannelJoin Now

PHP Iterables Function Example

Hi Dev,

Today, i we will show you PHP iterables function example. This article will give you simple example of PHP iterables function example. you will learn PHP iterables function example. So let’s follow few step to create example of PHP iterables function example.

<!DOCTYPE html>
<html>
<body>

<?php
    function printIterable(iterable $myIterable) {
      foreach($myIterable as $item) {
        echo $item;
      }
    }

    $arr = ["a", "b", "c"];
    printIterable($arr);
?>

</body>
</html>

output:

abc

Recommended Posts