LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 7 of 106
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
Compare given date with today

I have following $var = "2010-01-21 00:00:00.0" I'd like to compare this date against today's date (i.e. I'd like to know if thi...

general-dev Solved
AL
asked 1 month ago by alexus
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
4 views
How to Remove Array Element and Then Re-Index Array?

I have some troubles with an array. I have one array that I want to modify like below. I want to remove element (elements) of it by index and then re-index arra...

database Solved
DA
asked 1 month ago by daGrevis
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
Set a cookie to never expire

Looking at the [php documentation on setting a cookie][1] I see that I can set an expiration date for the cookie. You can set the cookie to expire at the end o...

general-dev Solved
BR
asked 1 month ago by brainimus
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
How to render a DateTime object in a Twig template

One of my fields in one of my entities is a "datetime" variable. How can I convert this field into a string to render in a browser? Here is a co...

general-dev Solved
CH
asked 1 month ago by Chris Ridmann
0 votes
1 ans
3 views
Which version of CodeIgniter am I currently using?

Is there something similar to a `phpinfo()` - that would display the version for CodeIgniter?

general-dev Solved
DI
asked 1 month ago by Dirk
0 votes
1 ans
3 views
Adding one day to a date

My code to add one day to a date returns a date before day adding: `2009-09-30 20:24:00` date after adding one day SHOULD be rolled over to the next month: `1...

general-dev Solved
IA
asked 1 month ago by ian
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
Parse query string into an array

How can I turn a **string** below into an **array**? pg_id=2&parent_id=2&document&video This is the array I am looking for, array(...

database Solved
RU
asked 1 month ago by Run