LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

366 solutions found in php-dev

Page 9 of 19
0 votes
2 ans
3 views
PHP exec() vs system() vs passthru()

What are the differences? Is there a specific situation or reason for each function? If yes, can you give some examples of those situations? PHP.net says...

php-dev Solved
CO
asked 1 month ago by codingbear
0 votes
1 ans
3 views
How to get xdebug var_dump to show full object/array

I am using [xdebug][1] (php_xdebug-2.1.2-5.3-vc9.dll) on [WAMP][2]. When I use `var_dump` on a large object or variable it does not show the full variable....

php-dev Solved
DM
asked 1 month ago by dm03514
0 votes
1 ans
3 views
Passing base64 encoded strings in URL

Is it safe to pass raw base64 encoded strings via GET parameters?

php-dev Solved
AL
asked 1 month ago by Alix Axel
0 votes
1 ans
3 views
How to Convert Boolean to String

I have a Boolean variable which I want to convert to a string: $res = true; I need the converted value to be of the format: `"true" "fa...

php-dev Solved
TA
asked 1 month ago by tag
0 votes
1 ans
3 views
Matching a space in regex

How can I match a space character in a PHP regular expression? I mean like "gavin schulz", the space in between the two words. I am using a regular...

php-dev Solved
GA
asked 1 month ago by Gavin Schulz
0 votes
1 ans
3 views
Get Specific Columns Using “With()” Function in Laravel Eloquent

I have two tables, `User` and `Post`. One `User` can have many `posts` and one `post` belongs to only one `user`. In my `User` model I have a `hasMany` rela...

php-dev Solved
AW
asked 1 month ago by Awais Qarni
0 votes
1 ans
3 views
Print PHP Call Stack

I'm looking for a way to print the call stack in PHP. Bonus points if the function flushes the IO buffer.

php-dev Solved
JU
asked 1 month ago by Justin
0 votes
1 ans
3 views
What is the difference between var_dump() and print_r() in terms of spitting out an array as string?

What is the difference between `var_dump()` and `print_r()` in terms of spitting out an array as string?

php-dev Solved
IN
asked 1 month ago by ina
0 votes
1 ans
3 views
How to get time difference in minutes in PHP

How to calculate minute difference between two date-times in PHP?

php-dev Solved
TO
asked 1 month ago by Tom Smykowski
0 votes
1 ans
3 views
Error “Target class controller does not exist” when using Laravel 8

**Here is my controller:** <?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use Illuminate\Http\Reque...

php-dev Solved
NG
asked 1 month ago by Nguyễn Việt Dũng
0 votes
1 ans
3 views
How to send a GET request from PHP?

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...

php-dev Solved
VE
asked 1 month ago by Veera
0 votes
1 ans
3 views
Proper Repository Pattern Design in PHP?

*Preface: I'm attempting to use the repository pattern in an MVC architecture with relational databases.* I've recently started learning TDD in PHP,...

php-dev Solved
JO
asked 1 month ago by Jonathan
0 votes
1 ans
3 views
Insert string at specified position

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.

php-dev Solved
AL
asked 1 month ago by Alex
0 votes
1 ans
3 views
How to post data in PHP using file_get_contents?

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...

php-dev Solved
PA
asked 1 month ago by Paras Chopra
0 votes
1 ans
3 views
PHP: How to send HTTP response code?

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...

php-dev Solved
PA
asked 1 month ago by Paulo Coghi
0 votes
1 ans
3 views
PHP7 : install ext-dom issue

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...

php-dev Solved
AL
asked 1 month ago by alex
0 votes
2 ans
3 views
PHP "php://input" vs $_POST

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...

php-dev Solved
LE
asked 1 month ago by Lee
0 votes
1 ans
3 views
Best way to initialize an (empty) array in PHP

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...

php-dev Solved
TO
asked 1 month ago by Tom Auger
0 votes
1 ans
3 views
Explode PHP string by new line

Simple, right? Well, this isn't working :-\ $skuList = explode('\n\r', $_POST['skuList']);

php-dev Solved
BE
asked 1 month ago by Ben
0 votes
1 ans
3 views
PHP function to generate v4 UUID

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&#3...

php-dev Solved
AN
asked 1 month ago by anomareh