Setting up a PHP interpreter in PhpStorm

I am a beginner in web development and am having trouble trying to figure out how to set up a CLI interpreter for PHP. I don’t know what to do to set up an interpreter and the JetBrains tutorials seem to assume that I already have available interpreters. I have previously used AWS to make … Read more

Setting up a PHP interpreter in PhpStorm

I am a beginner in web development and am having trouble trying to figure out how to set up a CLI interpreter for PHP. I don’t know what to do to set up an interpreter and the JetBrains tutorials seem to assume that I already have available interpreters. I have previously used AWS to make … Read more

Why use $_SERVER[‘PHP_SELF’] instead of “”

The action attribute will default to the current URL. It is the most reliable and easiest way to say “submit the form to the same place it came from”. There is no reason to use $_SERVER[‘PHP_SELF’], and # doesn’t submit the form at all (unless there is a submit event handler attached that handles the submission).

HTML Element Array, name=”something[]” or name=”something”?

PHP uses the square bracket syntax to convert form inputs into an array, so when you use name=”education[]” you will get an array when you do this: So for example: Will give you all entered values inside of the $_POST[‘education’] array. In JavaScript, it is more efficient to get the element by id… The id doesn’t have to match … Read more

Redirect vs RedirectMatch

Redirect is supposed to redirect all URLs starting with the string. Since the URL you redirect to started with that string, naturally you instantly redirected again. RedirectMatch redirects URLs that match a regular expression. You used $ to explicitly match the end of the URL as part of that. That means that “starting with” is not enough.

How to listen messageSent event in laravel 5.5

You can pass data from the controller to the mailable, and then from the mailable to the listener For example I have a model called SendOrder that I use to keep track the status of the email, so I pass this model from the controller to the listener This is what you have to do from scratch … Read more

break out of if and foreach

if is not a loop structure, so you cannot “break out of it”. You can, however, break out of the foreach by simply calling break. In your example it has the desired effect: Just for completeness for others that stumble upon this question looking for an answer.. break takes an optional argument, which defines how many loop structures it should break. Example: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)