The news feed items should contain:
- Title
- Content
- Author
- Published date
- Like counter (the number of likes a news feed item has received)
The news feed author items should contain the following data:
- ID
- Full name
The project should use the following PHP functionality:
- Variables
- Multiple data types
- Arrays
- Functions
- Loops (for, while or foreach)
- Output (echo, print etc.)
PHP 7.3.11 installed
-
Clone down the project to your computer
$ git clone https://github.com/majaalin/plain-news.git
-
Start a local server in the resources folder in the command line
$ php -S localhost:1337
-
Open the index.php file in your browser
- Terese Thulin
- Victor Ljungblad
From Oskar Joss
index.php:36-49
The foreach loop may be more readable if you first make a list of the different items you would like to print, like $title = article ['title'] etc., and then only print $title in the document itselffunctions.php:19-20
The usort function was a bit hard to understand. Maybe it’s easier to do like the first example in the PHP documentation
This project is licensed under the MIT License - see the LICENSE file for details