LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

2109 solutions found in plugin-api

Page 7 of 106
0 votes
2 ans
9 views
What does a \ (backslash) in front of function names mean?

What does a `\` do in PHP? For example, [CSRF4PHP](https://github.com/foxbunny/CSRF4PHP/blob/60d9172b7f0cd93346cac9065fb17182854ebf1c/CsrfToken.php#L80-L87)...

php-dev Solved
AL
asked 3 months ago by Alfred
0 votes
2 ans
8 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 3 months ago by Aakash Chakravarthy
0 votes
2 ans
10 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 3 months ago by Brent
0 votes
3 ans
10 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 3 months ago by alexus
0 votes
1 ans
7 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 3 months ago by Ian
0 votes
1 ans
7 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 3 months ago by gbhall
0 votes
2 ans
8 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 3 months ago by Kendall Hopkins
0 votes
2 ans
15 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 3 months ago by daGrevis
0 votes
1 ans
6 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 3 months ago by user3379466
0 votes
1 ans
8 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 3 months ago by thesonix
0 votes
1 ans
7 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 3 months ago by Abs
0 votes
3 ans
8 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 3 months ago by brainimus
0 votes
1 ans
8 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 3 months ago by phoenixwizard
0 votes
2 ans
8 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 3 months ago by Sandeepan Nath
0 votes
2 ans
8 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 3 months ago by bgosalci
0 votes
1 ans
7 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 3 months ago by Pezhvak
0 votes
3 ans
7 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 3 months ago by Chris Ridmann
0 votes
3 ans
9 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 3 months ago by Dirk
0 votes
3 ans
9 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 3 months ago by ian
0 votes
2 ans
9 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 3 months ago by Iftakharul Alam