课程: PHP for WordPress (2020)

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Solution: Perform a mathematic operation and store it

Solution: Perform a mathematic operation and store it - PHP教程

课程: PHP for WordPress (2020)

Solution: Perform a mathematic operation and store it

(bright music) - [Instructor] All right, let's walk through the solutions. The first thing we're going to do is create an array called results. We'll just make it blank for now. The nice thing about arrays is that you can define them as blank, and then, just add new entries to them and I'll show you exactly how to do that. So the first arithmetic operator is nine plus two times five minus 11. So we'll type results, and then, we can do this assignment one of two ways. We can just leave the brackets empty, which will give it a numeric index or we can add a string inside of it, like A, since it was labeled as A on the challenge slide, and then, it would be an associate of array where it has a string index. Let's just stick with the numeric indexes for now, and then, we will do the assignment. That's nine plus, I want to do, in parenthesis, two times five, to make it explicit, minus 11. Now this should give us the…

内容