Quantcast
Channel: PHP Solutions – Lampdocs.com
Browsing latest articles
Browse All 18 View Live

How to Open Links in a New Tab in Hesk 2.5.2

If you have used Hesk before, you must have mentioned that all links that were posted by users at the time of ticlet creation/reply were opening in new tabs. If you decide to update to 2.5.2 (I was...

View Article



Setting Timeout Value for file_get_contents in PHP

Sometimes you need to avoid using cURL for getting external web content for any reasons. You’re lucky that PHP has some built-in functions that allow you to get data from the Web without cURL. But if...

View Article

SMTP ERROR: Failed to connect to server: Connection refused (111) –...

Sometimes users need to send outgoing e-mails with external SMTP servers. Most popular example is PHPMailer with its ability to use free SMTP servers, for example Gmail. Here is the short piece of...

View Article

How to Show Current Query When Using Activerecord in Yii2

Today just a simple command. If you need to know the current query for an Activerecord object, you need this simple command: $query->createCommand()->getRawSql(); This will show current SQL...

View Article

How to Enable Optional Trailing Slash in Yii2 URLs

Inspired from Github If you have links, that might end with slashes (sometimes they are being added automatically), you won’t be able to handle them unless you add a string to your Yii2 project...

View Article


How to Set Up Custom HTTPD Configuration for Yii2 on a Directadmin Server...

Today I’m coming with a setting for Yii2, as I haven’t found any documentation about this. So we will set up advanced template of Yii, on a Directadmin server, running on nginx. First of all, you need...

View Article

How to convert small value in PHP like 1.0 E-5 to “normal” view

Sometimes you might have small numbers in PHP. So small, that they are automatically converted to exponential format. In order to show them as numbers, here is the code: $number=...

View Article

Image may be NSFW.
Clik here to view.

How to Generate Multisig Bitcoin Addresses with the list of xpubs in PHP

Another script, that I had to create by myself, since I haven’t found a solution for such a simple task. Let’s say you create a multisig Bitcoin wallet in Electrum. Let’s start with a basic version...

View Article


How to Query an ElectrumX Server with PHP

Spent several hours today figuring out how to interact with an ElectrumX server, and it resulted into just several lines of code. I hope this will save someone time. I will show 2 versions – for TCP...

View Article


How to get the Redeem Script for a P2SH Address From Private Key with PHP

Just a quick piece of code, that is using Bitwasp library to mare redeem script from private key <?php require __DIR__ . "/vendor/autoload.php"; use BitWasp\Bitcoin\Key\Factory\PrivateKeyFactory;...

View Article
Browsing latest articles
Browse All 18 View Live




Latest Images