A photo of a homeless boy using McDonald's light to study goes viral inspiring people across the world to value education.Getty Images

A homeless boy who was photographed doing his homework by the light from a McDonald's has been given a college scholarship.

The images of Daniel Cabrera sitting on a small bench on the pavement outside the restaurant went viral, after they were posted on Facebook by a 20-year-old medical technology student Joyce Torrefranca.

According to Sky News, the student said: "For me as a student, it just hit me a lot. This kid, he doesn't have anything but he has dedication to study."

We're overjoyed. I don't know what I will do with all of these blessings. Now, Daniel will not have to suffer just to finish his studies.

- Christina Espinosa

Daniel, who is a grade three student, lost the slum dwelling he shared with his mother and siblings after their house was gutted by fire.

His mother Christina Espinosa told AFP that she and her three youngest children, including Daniel, had been living in her employer's mini-grocery store in Mandaue, on the island of Cebu.

Having limited access to electric light, the conscientious young student goes to the McDonald's where he sits nightly under the glow of the lights of the fast-food chain to do his homework.

After his father died of severe diarrhoea in 2013, he has expressed his determination to get an education in order to support his family.

Daniel's determination to obtain an education in the face of adversity moved millions of others, prompting people to come forward with donations of cash, school supplies and a college scholarship. Others have donated school uniforms and a reading lamp.

Daniel's mother, said: "He is a very studious and determined boy... he would insist on going to school even without his lunch money because I have no money to give. He always tells me: 'Mama, I don't want to stay poor. I want to reach my dreams'."

"We're overjoyed. I don't know what I will do with all of these blessings. Now, Daniel will not have to suffer just to finish his studies."

Daniel's plight is similar to that of millions of street children in Manila. His mother earns just 80 pesos (£1.15) a day and is forced to boost her income by selling cigarettes and sweets on the streets outside of work hours to provide for her family. Many children from impoverished homes are often compelled to turn to begging for money or hawking goods on the streets, but Daniel chose to get an education in the hope of becoming a policeman.

Mandaue's social welfare office chief said the challenge was now to manage the aid to make sure Daniel achieves his goal.

Violeta Cavada said: "He has become a symbol of poor slum boys in the city who can't study because they don't have electricity."

Ms Torrefranca, who posted the photo said she was happy that she was able to help the young boy.

"I couldn't believe how my post went viral and helped him in his studies," she said.

Around a quarter of the Philippines' 100 million population live on less than 60 pence a day.