Gurinder121
1 week ago

Help with PHP code

Posted 1 week ago by Gurinder121

Hi guys,

I'm new to programming. If I need to put down more info, please let me know a command

Warning: Invalid argument supplied for foreach() in /Users/gurinderkhabra/Desktop/php-learning/index.view.php on line 10

Here is the command

Document
<ul>
	<?php foreach ($tasks as $task) : ?>   <! -- this is line 10 -->
		<li>
			<?php if ($task->completed) : ?>
				<strike><?= $task->description; ?></strike>
			<?php endif; ?>
		</li>
	<?php endforeach; ?>
	</ul>

</body>
</html>

Please sign in or create an account to participate in this conversation.