Category "php"

Converting IPv6 to IPv4 address in PHP

I need to convert IPv6 addresses to IPv4 addresses. To do this, I used code from pedmillon's answer to a related question: $ipv6 = $_SERVER['REMOTE_ADDR']; $ip

Problems getting instance of UploadedFile in Yii2

I tried to upload a file to a server using UploadedFile class, but I can't get an Instance. In my Model: public $arch; public function rules() { return [[[

How to use PHPCBF to fix one issue at a time?

I've added a PHPCS configuration to get some standards into a legacy project. I'm using a relaxed version of PSR-2 as an interim step. Now what I want to do, i

WAMP Virtual Host not working

I am using a wamp version 2.5 My Apache is 2.4.9 PHP: 5.5.12 MySQL: 5.6.17 I have these configurations: On my httpd.conf # Virtual hosts Include conf/extra/h

Non Receipt of the email sent by XAMPP Mercury Server with Gmail SMTP Settings at Local Host

I have setup the php.ini and sendmail.ini with smtp.gmail.com with my gmail ID and password with my xampp folder on local computer. The message is successfully

How to update array value in Laravel

My controller code: $userBasicInfoId = $this->userBasicInfo->where('user_id', $userProfile['id'])->value('id'); if($userBasicInfoId) {

file_put_content...fail to open stream:Permission denied in Laravel 5

The error is mention in below:- ErrorException in Filesystem.php line 81: file_put_contents(/var/www/html/Training-management-system/storage/framework/views

Font family issue in dompdf

I'm using DOMPDF v0.8.0 I'm having a problem with this library. I'm using this dompdf library with codeigniter2. I need to implement digital signature and co

How to show a popup modal in codeIgniter?

I have written a javascript click function to a class to display a popup when the relevant class be clicked. When i just put an alert it gives me the correct ou

How do I do HTTP basic authentication using Guzzle?

I want to do basic access authentication using Guzzle and I am very new to programming. I have no clue what to do. I tried to do this using curl but my environm

Filter array by skipping every nth element from the end

Is there an efficient way to get an array by skipping every n elements starting from the end (so that the last element is always in the result)? Basically, I ha

PHP DOTENV unable to load env vars

I'm using php dotenv for env vars for my php application. The readme says I can load php dotenv into my application with: $dotenv = new Dotenv\Dotenv(__DIR__

php artisan queue:flush does not flush the queues

Our log is blowing up due to non-stop retries by the queue workers despite having the retries set to 1 only. This is literally caused by 3 different failed job

Combine array with same value and add other [duplicate]

I'm trying to find a way to combine array with the same value, and add other values of associative array. I have an array of something like th

Use Ajax in Fat free framework to render route every 5 seconds

I need for help in fat free I want to use ajax to render to a specific route every 5 seconds But I can't console any data the ajax page and this is my php code

Retrieiving YouTube chat data from archived (completed) livestream

I am trying to figure out how to obtain the chat messages along with their details using the YouTube data API v3. I am able to obtain chat data while the strea

Artisan, creating tables in database

I am trying to create mysql tables in Laravel 5. I created a file in /project/database/migrations called users.php: [...] public function up() { Schema::cr

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

Please advise! During import of xlsx file I get formula and not result of the Formula. Changed config file excel.php to set 'calculate'=> true, on imports a

Get lat/lon from google maps url ftid (hex)

When using android google maps app share button for a location, it just return a url as intent to other applications like this one: https: // goo. gl / maps/tk

Creating Combinations of Elements

I want to create product option system. I have a form look like this: [![Sample image][2]][2](source: resmim.net) Form's inputs are tag inputs. First input is o