And historically on single-core CPU’s threads practically transformed into loops underneath. But the main idea is that in many languages, an async behavior is very easily achieved, maybe you need a keyword, maybe you need a special class, but in general, it is simple.
Now if you want the easiest way to do something asynchronous in PHP it will be a little costly, you can do that by spawning a new PHP process directly from PHP. View full article
Recently and currently(Laravel 5.6) Laravel is using Bootstrap-4 and they’ve updated all their views accordingly, and when you want to use Laravel’s pagination feature you may have a bit of a problem in the mobile world as there are too many page links to be shown in an esthetic way on a mobile screen.
So you can do a lot of things to resolve this problem but the simplest way available is to change the view which defines the links listening.
First, we need to publish that view, this will force Laravel to use the published view, not the one residing in the app-source/vendor directory.
We do that with the following command:
php artisan vendor:publish --tag=laravel-pagination
You should immediately see after executing the command the following:
View full article
Copied Directory [\vendor\laravel\framework\src\Illuminate\Pagination\resources\views] To [\resources\views\vendor\pagination]
PHPMailer is a popular library for sending emails as the project of the title suggests. In GitHub, the readme file has a nice example of a basic setup, but today I’ll give you a similar simple example using jQuery, Swal( Sweet alert ).
So first this is the PHP script that should respond to an ajax request (for example a file named smail.php):
View full article
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
//Load composer's autoloader
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
$name = htmlspecialchars($_POST["name"]);
$email = htmlspecialchars($_POST["email"]);
$msg = htmlspecialchars($_POST["message"]);
$recap = htmlspecialchars($_POST["g-recaptcha-response"]);
$gcapSecret = 'YOUR RECAPTCHA2 SECRET';
As you probably know running PHP on Windows is a bad idea as you can get into a plethora of problems even for a simple development setup but, when you want to test a quick script or you just want to write maybe a solution to an algorithmic problem found on some type of programmer improvement site that accepts solutions in PHP you can use of course some prebuild windows binaries from windows.php.net.
Anyway, the main gist of this mini-post is that I found a recurring bug with the CURL library, the bug has been reported before and it consists in the fact that the library will not load(even if you set up correctly php.ini) View full article