OSKY Web Developer Test - PHP Junior
The Task
- Create a PHP script to fulfil the requirement below.
- Upload your script to a public github repository.
The Requirement
- Download the JSON file from URL below and find a way to parse the content using only PHP built in function (no external libraries or tool).
- test.osky.dev/101/data.json
- The JSON file contains 6 news item with several attributes including
- Title
- Link
- Description/Content
- Published date
- Create a listing of the news wrapped inside a div and sort it according to the news title alphabetically.
- Use H2 tag for the news title.
- Use P tag for the date and make it an italic.
- Reformat the date as
- Day, Date, English ordinal suffix, "of", Long Month Name, Year, Hour with no leading zero, Minute, and Ante/Post Meridiem
- Example : Tuesday, 22nd of June 2021 10:07 pm
- Use P tag for the content.
- The link property can either be a string or an arrays. If it's in an array, filter the array values and if URL link is present in the news, a "Read More" text should appear and will open the full news story in a new window. IMPORTANT: Do not show the Read More link if only a URN or URC is present.
- OPTIONAL: Add a fade in effect on every news item so that each item will fade in one item at a time. You can use vanilla Javascript or jQuery for this.
Submission
- Upload your files to a PRIVATE Github repository and invite erfan.sakib@osky.com.au to view the repository.
- If you're having trouble with Git, just zip the files and send it through email at erfan.sakib@osky.com.au.
Good luck with the test!