LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 6 of 106
0 votes
1 ans
7 views
Fastest way to convert string to integer in PHP

Using PHP, what's the fastest way to convert a string like this: `"123"` to an integer? Why is that particular method the fastest? What happens...

php-dev Solved
NI
asked 2 months ago by nickf
0 votes
2 ans
11 views
How to remove the querystring and get only the URL?

I'm using PHP to build the URL of the current page. Sometimes, URLs in the form of www.example.com/myurl.html?unwantedthngs are requested. I want...

database Solved
NA
asked 2 months ago by Navi Gamage
0 votes
2 ans
12 views
How to query between two dates using Laravel and Eloquent?

I'm trying to create a report page that shows reports from a specific date to a specific date. Here's my current code: $now = date('Y-m-d&#39...

database Solved
WO
asked 2 months ago by wobsoriano
0 votes
1 ans
7 views
PHP check whether property exists in object or class

I understand PHP does not have a pure object variable, but I want to check whether a property is in the given object or class. $ob = (object) array('...

php-dev Solved
MI
asked 2 months ago by Micah
0 votes
1 ans
9 views
What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

I'm currently working on a website, which triggers a ```net::ERR_HTTP2_PROTOCOL_ERROR 200``` error on Google Chrome. I'm not sure exactly what can provo...

general-dev Solved
TR
asked 2 months ago by Tristan G
0 votes
2 ans
10 views
413 Request Entity Too Large - File Upload Issue

I am trying to upload 30MB file on my server and its not working. 1. When I upload 30MB file, the page loads "**Page Not Found**" 2. When I uplo...

general-dev Solved
RA
asked 2 months ago by Raju Vishwas
0 votes
1 ans
7 views
Fatal error: Class 'ZipArchive' not found in

I have a problem when I install 'Archive_Zip 0.1.1' on the Linux server, but when I try to run the script to create the zip file it gives the fatal erro...

php-dev Solved
PA
asked 2 months ago by Parag Chaure
0 votes
1 ans
7 views
How to include() all PHP files from a directory?

In PHP can I include a directory of scripts? i.e. Instead of: include('classes/Class1.php'); include('classes/Class2.php'); is...

php-dev Solved
OC
asked 2 months ago by occhiso
0 votes
2 ans
8 views
What is the meaning of three dots (...) in PHP?

While I am installing Magento 2 on my Server, I got an error. After investigating the code and found that there are three dots (`...`), which is producing the e...

php-dev Solved
AB
asked 2 months ago by abu abu
0 votes
1 ans
6 views
Laravel PHP command not found

I installed Laravel using Composer without problems, but when I try to run `laravel` in the terminal, I get the following error: > -bash: laravel: command...

php-dev Solved
CH
asked 2 months ago by chemitaxis
0 votes
2 ans
8 views
Send attachments with PHP Mail()?

I need to send a pdf with mail, is it possible? $to = "xxx"; $subject = "Subject" ; $message = 'Example message with...

php-dev Solved
US
asked 2 months ago by user1537415
0 votes
1 ans
7 views
Fatal error: Class 'SoapClient' not found

I'm trying a simple web service example and I get this error even though I uncommented `extension=php_soap.dll` in the `php.ini` file: > **Fatal error...

php-dev Solved
FI
asked 2 months ago by Figen Güngör
0 votes
1 ans
6 views
Force SSL/https using .htaccess and mod_rewrite

How can I force to SSL/https using .htaccess and mod_rewrite page specific in PHP.

server-admin Solved
SA
asked 2 months ago by Sanjay Shah
0 votes
2 ans
8 views
Get random item from array

$items = Array(523,3452,334,31,...5346); Each item of this array is some number. **How do I get random item from `$items`?**

php-dev Solved
JA
asked 2 months ago by James
0 votes
2 ans
8 views
Tactics for using PHP in a high-load site

Before you answer this I have never developed anything popular enough to attain high server loads. Treat me as (sigh) an alien that has just landed on the plane...

php-dev Solved
RO
asked 2 months ago by Ross
0 votes
2 ans
10 views
How to get current route in Symfony 2?

How do I get the current route in [Symfony][1] 2? For example, `routing.yml`: somePage: pattern: /page/ defaults: { _controller: &quot...

general-dev Solved
IL
asked 2 months ago by IlyaDoroshin
0 votes
2 ans
14 views
How to prevent form resubmission when page is refreshed (F5 / CTRL+R)

I have a simple form that submits text to my SQL table. The problem is that after the user submits the text, they can refresh the page and the data gets submitt...

general-dev Solved
US
asked 2 months ago by user701510
0 votes
2 ans
8 views
Correctly determine if date string is a valid date in that format

I'm receiving a date string from an API, and it is formatted as `yyyy-mm-dd`. I am currently using a regex to validate the string format, which works ok,...

php-dev Solved
MA
asked 2 months ago by Marty Wallace
0 votes
1 ans
7 views
Unzip a file with php

I want to unzip a file and this works fine system('unzip File.zip'); But I need to pass in the file name through the URL and can not get it to...

php-dev Solved
BO
asked 2 months ago by BostonBB
0 votes
2 ans
8 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 2 months ago by Alfred