Created
November 26, 2024 18:28
-
-
Save mehmetsarr/b7b2535676415f9482183f05bdba3981 to your computer and use it in GitHub Desktop.
PHP foreach list limit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$i = 0; | |
foreach($data as $key => $row){ | |
if(++$i > 2) break; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment