I think I'm doing PHP for Computer Science 30. I can't exactly remember, but it doesn't look easy at all.
PHP is a multi-paradigm language. That pretty much means that you can code using it in quite a few different ways. So you can just write little snippets of code to insert something inline quickly, which tends to be ugly:
Or you can write functions anywhere to allow you to code in a procedural style.
Code:
function add($x, $y)
{
return $x + $y;
}
echo add(2, 2);
Or you can go object oriented and create classes in very much the same way as Java.
Code:
class Math{
function add($x, $y)
{
return $x + $y;
}
}
$math = new Math();
echo $math->add(2, 2);
As long as you have a paradigm figured out, it is incredibly easy to write in PHP. Its API is quite easy to browse, and there is quite a bit of example code in the documentation. Also if you can't figure something out, most PHP problems can be solved easily with Google because they most likely have been asked about a billion times before you start having issues, so it's really easy to find answers.
Also, if you ever write code with errors that causes you to have a blank screen, check the server log, it will tell you what you did wrong.
That said, I'm warning you now, there are a fair amount of criticisms for the language, so if you write anything in it, you'll hear
these from pretty much everyone.
And while these criticisms are true, they don't really detract from the fact that you can really get a lot accomplished with very little PHP code, and it will usually be relatively readable. Much more so than one of the languages that it got a lot of ideas from: Perl. (As much as I like the language.)
ProtipPro Advice:
Take out the https://www.youtube.com/watch?v= in a youTube URL to embed it.
Dammit. Fixed. Thanks...