2108 solutions found
Page 16 of 106votes
What is the difference between `var_dump()` and `print_r()` in terms of spitting out an array as string?
votes
How to calculate minute difference between two date-times in PHP?
votes
**Here is my controller:** <?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use Illuminate\Http\Reque...
votes
Our (PHP) framework sometimes renders hidden inputs with value `YTowOnt9`. I can't find that string anywhere in the (huge) codebase, and can't figure ou...
votes
I'm planning to use PHP for a simple requirement. I need to download a XML content from a URL, for which I need to send HTTP GET request to that URL. Ho...
votes
*Preface: I'm attempting to use the repository pattern in an MVC architecture with relational databases.* I've recently started learning TDD in PHP,...
votes
I'd like a cleaner way to obtain the following functionality, to catch `AError` and `BError` in one block: try { /* something */ }...
votes
I have a line like this in my CSV: `"Samsung U600 24"","10000003409","1","10000003427"` Quote next to `24` is...
votes
Is there a PHP function that can do that? I'm using `strpos` to get the position of a substring and I want to insert a `string` after that position.
votes
I'm using PHP's function `file_get_contents()` to fetch contents of a URL and then I process headers through the variable `$http_response_header`. No...
votes
I have a PHP script that needs to make responses with HTTP response codes (status-codes), like HTTP 200 OK, or some 4XX or 5XX code. How can I do this in PHP...
votes
I'm running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install `cviebrock/eloquent-sluggable` package throw some error: pish@let:/home...
votes
I have searched on the web for over two days now, and probably have looked through most of the online documented scenarios and workarounds, but nothing worked f...
votes
I have been directed to use the method `php://input` instead of `$_POST` when interacting with Ajax requests from JQuery. What I do not understand is the benefi...
votes
In certain other languages ([ActionScript 3][1] for example), it has been noted that initializing a new array is faster if done like this `var foo = []` rather...
votes
Simple, right? Well, this isn't working :-\ $skuList = explode('\n\r', $_POST['skuList']);
votes
So I've been doing some digging around and I've been trying to piece together a function that generates a valid v4 UUID in PHP. This is the closest I...
votes
It seems that PHP has two memcached libraries named [memcache][1] and [memcached][2]. What is the difference and how do you know which one to use? Is one outdat...
votes
I've recently stumbled over this code: function xrange($min, $max) { for ($i = $min; $i <= $max; $i++) { yield $i;...
votes
I want to sort multiple columns in Laravel 4 by using the method `orderBy()` in Laravel Eloquent. The query will be generated using Eloquent like this: S...