Category "php"

Return new collection without modifying original collection

I have a Laravel collection and I want to modify one of its property value to negative integer. For this I am using the collection map method but it also modify

Cannot load imagick library

I have installed the imagick from here (ImageMagick-7.0.3-1-Q16-x64-dll) and the dll (TS 32 bit) from here. And also copiend the CORE_RL_* to the C:\xampp\apach

How can I get a div content in php

I have a div in php(string) and I want to get the content. for example: <div id="product_list" style="width:100%; float:none;"> <div>

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Im trying to create a Gate in Laravel. The idea is to check if one of the roles is present on an AzureAD access token. So far I have this Gate::define('admin_cm

PHP SoapClient: set a namespace without prefix

I'm consuming a WSDL SOAP service using PHP's SoapClient. Here's the relevant bits of the WSDL: https://gist.github.com/jurchiks/03771c0b85683969bc48711e5669391

Converting array to string and then back in PHP

I created a array using PHP $userarray = array('UserName'=>$username,'UserId'=>$userId,'UserPicURL'=>$userPicURL); How can I convert this array into

Getting public posts of a random user from Facebook API

I want to get the latest posts of some random users (public posts of curse). I figured since they are public posts I don't need to ask permission from the owner

How to call a function inside of another function in PHP OOP

I'm making my own custom CMS using PHP Object Oriented... I have made a page where a main admin of a site can add another admin. In order to do this I made this

phpunit - testing is painfully slow

I am diving deeper and deeper in the world of unit testing. One issue I encountered, and this is where I would like feedback, is when one runs multiple test su

Reload parent page after submit in iframe

I have the same issue as in this question. (which has no correct answer, I just test all of them): Reload page after submit in iframe (javascript/jquery) What I

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

I am getting the following error message on the code below (which is at the end of the query): Warning: mysql_num_rows(): supplied argument i

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

I have a simple Lavel 4 project and I am trying to do a simple redirect to the previous page after the information has been submitted. However, when inserting R

netbeans problem : localhost/­PhpProject1/­index.­php not found

I have installed netbeans6.9.1 with java,c++ and php on windows 7. When i tried to run a test php code, the browser cant find the localhost. Pleas help me to g

Show Custom Data in Woocommerce Order Details Admin Area

When a User Buys a Product he can generate up to 3 Serial Keys for his Product. This works fine so far. The User can see his Serials always in "my account" The

add uri parameter to Route name in laravel

I'm working on a Laravel project, and I made a simple CRUD system, but I have a small problem to generate the URL system in my project, I made a Route::macro

Fatal error: [] operator not supported for strings

I'm getting information from database, saving it in array and echoing it in a form with loop structure and I'm having problems when I try to save the modified i

PHP drop down list using array's and foreach (else and for) code

I'm taking a course called "Dynamic Web Development with PHP" and after getting an F for an exercise, I wish if you could help me with the following. I have a p

Uploading video to Youtube using Youtube Data API V3 and Google API Client PHP -- getting 401 (unauthorized) message

I have to implement a way to upload video from our site to youtube. I already registered the app in Google Cloud and got all the necessary client ID, client sec

The "client_reference_id" argument is not passed

I use Stripe Checkout (Stripe version 2016-07-06) and I want to recover a personalized data thanks to the argument "client_reference_id" but in the JSON I do no

correct PHP headers for pdf file download

I'm really struggling to get my application to open a pdf when the user clicks on a link. So far the anchor tag redirects to a page which sends headers that are