LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

366 solutions found in php-dev

Page 3 of 19
0 votes
1 ans
3 views
What is cURL in PHP?

In PHP, I see the word cURL in many PHP projects. What is it? How does it work? Reference Link: [cURL](http://php.net/manual/en/book.curl.php)

php-dev Solved
AA
asked 1 month ago by Aakash Chakravarthy
0 votes
1 ans
3 views
How to make HTTP requests in PHP and not wait on the response

Is there a way in PHP to make HTTP calls and not wait for a response? I don't care about the response, I just want to do something like `file_get_contents()...

php-dev Solved
BR
asked 1 month ago by Brent
0 votes
1 ans
3 views
How to remove duplicate values from an array in PHP

How can I remove duplicate values from an array in PHP?

php-dev Solved
IA
asked 1 month ago by Ian
0 votes
1 ans
3 views
Check whether an array is empty

I have the following code <?php $error = array(); $error['something'] = false; $error['somethingelse'] = false; if (!empt...

php-dev Solved
GB
asked 1 month ago by gbhall
0 votes
1 ans
3 views
Anonymous recursive PHP functions

Is it possible to have a PHP function that is both recursive and anonymous? This is my attempt to get it to work, but it doesn't pass in the function name....

php-dev Solved
KE
asked 1 month ago by Kendall Hopkins
0 votes
1 ans
3 views
How can I use Guzzle to send a POST request in JSON?

Does anybody know the correct way to `post` JSON using `Guzzle`? $request = $this->client->post(self::URL_REGISTER,array( 'content-typ...

php-dev Solved
US
asked 1 month ago by user3379466
0 votes
1 ans
3 views
Illegal string offset Warning PHP

I get a strange PHP error after updating my php version to 5.4.0-3. I have this array: Array ( [host] => 127.0.0.1 [port] =&...

php-dev Solved
TH
asked 1 month ago by thesonix
0 votes
1 ans
3 views
Simplest way to detect a mobile device in PHP

What is the simplest way to tell if a user is using a mobile device to browse my site using PHP? I have come across many classes that you can use but I was h...

php-dev Solved
AB
asked 1 month ago by Abs
0 votes
1 ans
3 views
Bulk Insertion in Laravel using eloquent ORM

How can we perform bulk database insertions in Laravel using Eloquent ORM? I am working with an XML document, looping through its elements. I want to accompl...

php-dev Solved
PH
asked 1 month ago by phoenixwizard
0 votes
1 ans
3 views
PHP sprintf escaping %

I want the following output:- > About to deduct 50% of € 27.59 from your Top-Up account. when I do something like this:- $variablesArray[0] = &...

php-dev Solved
SA
asked 1 month ago by Sandeepan Nath
0 votes
1 ans
3 views
Why a function checking if a string is empty always returns true?

I have a function isNotEmpty which returns true if the string is not empty and false if the string is empty. I've found out that it is not working if I pass...

php-dev Solved
BG
asked 1 month ago by bgosalci
0 votes
1 ans
3 views
Array and string offset access syntax with curly braces is deprecated

I've just updated my php version to 7.4, and i noticed this error pops up: > Array and string offset access syntax with curly braces is deprecated...

php-dev Solved
PE
asked 1 month ago by Pezhvak
0 votes
1 ans
3 views
Access Controller method from another controller in Laravel 5

I have two controllers `SubmitPerformanceController` and `PrintReportController`. In `PrintReportController` I have a method called `getPrintReport`. How...

php-dev Solved
IF
asked 1 month ago by Iftakharul Alam
0 votes
1 ans
3 views
Can you "compile" PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?

I know that PHP is compiled to byte code before it is run on the server, and then that byte code can be cached so that the whole script doesn't have to be r...

php-dev Solved
CA
asked 1 month ago by Carson Myers
0 votes
1 ans
3 views
What is the point of interfaces in PHP?

[Interfaces](http://php.net/Interfaces) allow you to create code that defines the methods of classes that implement it. You cannot however add any code to those...

php-dev Solved
MK
asked 1 month ago by mk.
0 votes
1 ans
3 views
Converting a UNIX Timestamp to Formatted Date String

Using PHP, I want to convert UNIX timestamps to date strings similar to this: `2008-07-17T09:24:17Z` How do I convert a timestamp such as `1333699439` to `20...

php-dev Solved
UT
asked 1 month ago by Utku Dalmaz
0 votes
1 ans
3 views
How are echo and print different in PHP?

> **Possible Duplicate:** > [Reference: Comparing PHP's print and echo](https://stackoverflow.com/questions/7094118/reference-comparing-phps-pr...

php-dev Solved
ZU
asked 1 month ago by zuk1
0 votes
1 ans
3 views
PHP - Failed to open stream : No such file or directory

In PHP scripts, whether calling `include()`, `require()`, `fopen()`, or their derivatives such as `include_once`, `require_once`, or even, `move_uploaded_file()...

php-dev Solved
VI
asked 1 month ago by Vic Seedoubleyew
0 votes
1 ans
3 views
Generating a random password in php

I am trying to generate a random password in php. However I am getting all 'a's and the return type is of type array and I would like it to be a str...

php-dev Solved
NU
asked 1 month ago by nunos
0 votes
1 ans
3 views
Get the client IP address using PHP

I want to get the client IP address who uses my website. I am using the PHP `$_SERVER` superglobal: $_SERVER['REMOTE_ADDR']; But I see it can...

php-dev Solved
US
asked 1 month ago by user1752627