SyntaxFix
Write A Post
Hire A Developer
Questions
You don't need to do it in the foreach.
foreach
Just use count($Contents).
count($Contents)