<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/tuts_plus/best-of/2021/12" -->

---
title: Best Tuts+ posts — December 2021 | daily.dev
description: The most upvoted Tuts+ posts from December 2021, curated by the daily.dev community.
canonical: https://daily.dev/sources/tuts_plus/best-of/2021/12
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/tuts_plus/best-of/2021/12
og:type: website
og:site_name: daily.dev
og:title: Best Tuts+ posts — December 2021 | daily.dev
og:description: The most upvoted Tuts+ posts from December 2021, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Tuts+ — December 2021

1. 1  
[](https://daily.dev/posts/php-magic-methods-cheatsheet-l6iweezrn "PHP Magic Methods Cheatsheet")  
Article  
![Avatar of tuts_plus](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tuts_plus)Tuts+ · 5y  
PHP Magic Methods Cheatsheet  
PHP magic methods allow you to perform various operations with objects. The best example of a magic method is the \_\_construct() function, which is called automatically when the object is instantiated. The aim of this article is to go through all the magic methods in PHP and explain each one briefly.  
35
2. 2  
[](https://daily.dev/posts/how-to-use-yield-and-generators-in-php-j63gdmtkp "How to Use Yield and Generators in PHP")  
Article  
![Avatar of tuts_plus](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tuts_plus)Tuts+ · 5y  
How to Use Yield and Generators in PHP  
The word yield means produce or generate which is basically what the keyword does in PHP. It generates a value for use outside your function without entirely stopping its execution and returning. It gives you the ability to pause the execution while you do something else with the returned value. The advantage of using generators is low memory usage.  
13
3. 3  
[](https://daily.dev/posts/read-a-csv-to-array-in-php-vyo985jbc "Read a CSV to Array in PHP")  
Article  
![Avatar of tuts_plus](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/tuts_plus)Tuts+ · 5y  
Read a CSV to Array in PHP  
In this article, we'll learn how to read and print a simple CSV file. We'll use fopen() and fgetcsv() to read the contents of a CSV file, then we'll convert it into an array using the array\_map() and str\_get CSV() functions. The words found in the file are then looped through and printed into an HTML table.  
11  
2

[See all Tuts+ archives](/sources/tuts%5Fplus/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/tuts_plus/best-of/2021/12#page","url":"https://daily.dev/sources/tuts_plus/best-of/2021/12","name":"Best Tuts+ Posts — December 2021","description":"The most upvoted Tuts+ posts from December 2021, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/tuts_plus/best-of/2021/12#items","numberOfItems":3,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/php-magic-methods-cheatsheet-l6iweezrn","name":"PHP Magic Methods Cheatsheet"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/how-to-use-yield-and-generators-in-php-j63gdmtkp","name":"How to Use Yield and Generators in PHP"},{"@type":"ListItem","position":3,"url":"https://daily.dev/posts/read-a-csv-to-array-in-php-vyo985jbc","name":"Read a CSV to Array in PHP"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Tuts+","item":"https://daily.dev/sources/tuts_plus"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/tuts_plus/best-of"},{"@type":"ListItem","position":5,"name":"December 2021"}]}]}
```

