Skip to content

Commit

Permalink
php day 1 implementation (#184)
Browse files Browse the repository at this point in the history
* php solution

* Add @willianwt as a contributor

* readme updated
  • Loading branch information
willianwt authored and MadhavBahl committed Jan 16, 2019
1 parent 5e4ab90 commit 8f06c4d
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
12 changes: 11 additions & 1 deletion .all-contributorsrc
Expand Up @@ -221,6 +221,16 @@
"doc",
"code"
]
},
{
"login": "willianwt",
"name": "Willian Taiguara Baliza Moura",
"avatar_url": "https://avatars0.githubusercontent.com/u/2049543?v=4",
"profile": "https://github.com/willianwt",
"contributions": [
"doc",
"code"
]
}
]
}
}
7 changes: 4 additions & 3 deletions CONTRIBUTORS.md
@@ -1,4 +1,4 @@
[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors)

## Contributors

Expand All @@ -8,8 +8,9 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
<!-- prettier-ignore -->
| [<img src="https://avatars2.githubusercontent.com/u/26179770?v=4" width="100px;"/><br /><sub><b>MADHAV BAHL</b></sub>](http://madhavbahl.tech/)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=MadhavBahlMD "Code") [📝](#blog-MadhavBahlMD "Blogposts") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=MadhavBahlMD "Documentation") [🎨](#design-MadhavBahlMD "Design") [✅](#tutorial-MadhavBahlMD "Tutorials") | [<img src="https://avatars2.githubusercontent.com/u/32531173?v=4" width="100px;"/><br /><sub><b>Rajdeep Roy Chowdhury</b></sub>](http://www.linkedin.com/in/razdeeproychowdhury)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Razdeep "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Razdeep "Documentation") [✅](#tutorial-Razdeep "Tutorials") | [<img src="https://avatars1.githubusercontent.com/u/16208722?v=4" width="100px;"/><br /><sub><b>Hrishi</b></sub>](https://hrishi1999.github.io)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishi1999 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Hrishi1999 "Code") | [<img src="https://avatars1.githubusercontent.com/u/33101287?v=4" width="100px;"/><br /><sub><b>Bhanu Ailani</b></sub>](https://github.com/Bhanu0202)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Bhanu0202 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Bhanu0202 "Code") | [<img src="https://avatars3.githubusercontent.com/u/35690440?v=4" width="100px;"/><br /><sub><b>Deepak Sharma</b></sub>](https://sourcerer.io/dsdsharma)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=dsdsharma "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dsdsharma "Code") | [<img src="https://avatars2.githubusercontent.com/u/28749866?v=4" width="100px;"/><br /><sub><b>Ramanpreet Singh</b></sub>](https://github.com/Ramanpreet6262)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Ramanpreet6262 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Ramanpreet6262 "Code") | [<img src="https://avatars1.githubusercontent.com/u/27620628?v=4" width="100px;"/><br /><sub><b>Anil Khatri</b></sub>](https://imkaka.github.io/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=imkaka "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=imkaka "Code") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars0.githubusercontent.com/u/39827514?v=4" width="100px;"/><br /><sub><b>Ashwek Swamy</b></sub>](https://github.com/ashwek)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Code") | [<img src="https://avatars1.githubusercontent.com/u/32368107?v=4" width="100px;"/><br /><sub><b>Dhruv Gupta</b></sub>](https://github.com/dhruv-gupta14)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dhruv-gupta14 "Code") | [<img src="https://avatars0.githubusercontent.com/u/30969577?v=4" width="100px;"/><br /><sub><b>Aadit Kamat</b></sub>](https://sg.linkedin.com/in/aadit-kamat-12a5a8140)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Code") | [<img src="https://avatars1.githubusercontent.com/u/20285786?v=4" width="100px;"/><br /><sub><b>Shashank jain</b></sub>](http://www.myshashank.tech)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Code") | [<img src="https://avatars3.githubusercontent.com/u/22260031?v=4" width="100px;"/><br /><sub><b>Moulik Aggarwal</b></sub>](https://github.com/moulikcipherX)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/21277179?v=4" width="100px;"/><br /><sub><b>Prateek Surana</b></sub>](http://prateeksurana.me)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Code") | [<img src="https://avatars2.githubusercontent.com/u/43927436?v=4" width="100px;"/><br /><sub><b>shivank86</b></sub>](https://github.com/shivank86)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=shivank86 "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/25405726?v=4" width="100px;"/><br /><sub><b>Vishal Shirke</b></sub>](https://github.com/vishalshirke7)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Code") | [<img src="https://avatars1.githubusercontent.com/u/25369498?v=4" width="100px;"/><br /><sub><b>profgrammer</b></sub>](https://github.com/profgrammer)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Code") | [<img src="https://avatars1.githubusercontent.com/u/26656036?v=4" width="100px;"/><br /><sub><b>divyakhetan</b></sub>](https://github.com/divyakhetan)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Code") | [<img src="https://avatars0.githubusercontent.com/u/36483814?v=4" width="100px;"/><br /><sub><b>Spreeha Dutta</b></sub>](https://github.com/Spreeha)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/26464695?v=4" width="100px;"/><br /><sub><b>Chaitanya Bhojwani</b></sub>](https://github.com/chaitanya-bhojwani)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Code") | [<img src="https://avatars0.githubusercontent.com/u/22885912?v=4" width="100px;"/><br /><sub><b>Manaswini Das</b></sub>](https://www.linkedin.com/in/manaswini-das/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=manaswinidas "Documentation") |
| [<img src="https://avatars0.githubusercontent.com/u/39827514?v=4" width="100px;"/><br /><sub><b>Ashwek Swamy</b></sub>](https://github.com/ashwek)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=ashwek "Code") | [<img src="https://avatars1.githubusercontent.com/u/32368107?v=4" width="100px;"/><br /><sub><b>Dhruv Gupta</b></sub>](https://github.com/dhruv-gupta14)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=dhruv-gupta14 "Code") | [<img src="https://avatars0.githubusercontent.com/u/30969577?v=4" width="100px;"/><br /><sub><b>Aadit Kamat</b></sub>](https://sg.linkedin.com/in/aadit-kamat-12a5a8140)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=aaditkamat "Code") | [<img src="https://avatars1.githubusercontent.com/u/20285786?v=4" width="100px;"/><br /><sub><b>Shashank jain</b></sub>](http://www.myshashank.tech)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Shashankjain12 "Code") | [<img src="https://avatars3.githubusercontent.com/u/22260031?v=4" width="100px;"/><br /><sub><b>Moulik Aggarwal</b></sub>](https://github.com/moulikcipherX)<br />[💬](#question-moulikcipherX "Answering Questions") [📝](#blog-moulikcipherX "Blogposts") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=moulikcipherX "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/21277179?v=4" width="100px;"/><br /><sub><b>Prateek Surana</b></sub>](http://prateeksurana.me)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=prateek3255 "Code") | [<img src="https://avatars2.githubusercontent.com/u/43927436?v=4" width="100px;"/><br /><sub><b>shivank86</b></sub>](https://github.com/shivank86)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=shivank86 "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/25405726?v=4" width="100px;"/><br /><sub><b>Vishal Shirke</b></sub>](https://github.com/vishalshirke7)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=vishalshirke7 "Code") | [<img src="https://avatars1.githubusercontent.com/u/25369498?v=4" width="100px;"/><br /><sub><b>profgrammer</b></sub>](https://github.com/profgrammer)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=profgrammer "Code") | [<img src="https://avatars1.githubusercontent.com/u/26656036?v=4" width="100px;"/><br /><sub><b>divyakhetan</b></sub>](https://github.com/divyakhetan)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=divyakhetan "Code") | [<img src="https://avatars0.githubusercontent.com/u/36483814?v=4" width="100px;"/><br /><sub><b>Spreeha Dutta</b></sub>](https://github.com/Spreeha)<br />[💻](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Code") [📖](https://github.com/CodeToExpress/dailycodebase/commits?author=Spreeha "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/26464695?v=4" width="100px;"/><br /><sub><b>Chaitanya Bhojwani</b></sub>](https://github.com/chaitanya-bhojwani)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=chaitanya-bhojwani "Code") | [<img src="https://avatars0.githubusercontent.com/u/22885912?v=4" width="100px;"/><br /><sub><b>Manaswini Das</b></sub>](https://www.linkedin.com/in/manaswini-das/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=manaswinidas "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/25549847?s=460&v=4" width="100px;"/><br /><sub><b>Anirudh Jwala</b></sub>](https://www.linkedin.com/in/anirudh-jwala-533859135/)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=anirudh-jwala "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=anirudh-jwala "Code") |
| [<img src="https://avatars0.githubusercontent.com/u/2049543?v=4" width="100px;"/><br /><sub><b>Willian Taiguara Baliza Moura</b></sub>](https://github.com/willianwt)<br />[📖](https://github.com/CodeToExpress/dailycodebase/commits?author=willianwt "Documentation") [💻](https://github.com/CodeToExpress/dailycodebase/commits?author=willianwt "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!
19 changes: 19 additions & 0 deletions Day1/PHP/fizzbuzz.php
@@ -0,0 +1,19 @@
<?php
/**
* @author willianwt
* @date 16/01/2018
*/

$num = n; #any number will work
for ($i=1; $i <= $num; $i++) {
if ($i % 3 == 0 && $i % 5 == 0) {
echo "FizzBuzz\n";
} else if ($i % 3 == 0) {
echo "Fizz\n";
}else if ($i % 5 == 0) {
echo "Buzz\n";
}else{
echo $i . "\n";
}

}
24 changes: 24 additions & 0 deletions Day1/README.md
Expand Up @@ -382,6 +382,30 @@ for i in range(1,n+1):
print(i)
```

## PHP Implementation

## fizzbuzz.php (./php/fizzbuzz.php)
```php

/*
* @author willianwt
* @date 16/01/2018
*/

$num = n; #any number will work
for ($i=1; $i <= $num; $i++) {
if ($i % 3 == 0 && $i % 5 == 0) {
echo "FizzBuzz\n";
} else if ($i % 3 == 0) {
echo "Fizz\n";
}else if ($i % 5 == 0) {
echo "Buzz\n";
}else{
echo $i . "\n";
}

}
```
### Have Another solution?

The beauty of programming lies in the fact that there is never a single solution to any problem.
Expand Down

0 comments on commit 8f06c4d

Please sign in to comment.