LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

2110 solutions found in plugin-api

Page 17 of 106
0 votes
2 ans
35 views
What does yield mean in PHP?

I've recently stumbled over this code: function xrange($min, $max) { for ($i = $min; $i <= $max; $i++) { yield $i;...

php-dev Solved
GO
asked 5 months ago by Gordon
0 votes
2 ans
47 views
How to order a Laravel query builder result by multiple columns?

I want to sort multiple columns in Laravel 4 by using the method `orderBy()` in Laravel Eloquent. The query will be generated using Eloquent like this: S...

database Solved
SO
asked 5 months ago by Sophy
0 votes
3 ans
32 views
Detect encoding and make everything UTF-8

I'm reading out lots of texts from various RSS feeds and inserting them into my database. Of course, there are several different character encodings used...

general-dev Solved
CA
asked 5 months ago by caw
0 votes
3 ans
37 views
Make XAMPP / Apache serve file outside of htdocs folder

Is it possible to configure [xampp][1] to serve up a file outside of the `htdocs` directory? For instance, say I have a file located as follows: `C:\proje...

server-admin Solved
CM
asked 5 months ago by cmcculloh
0 votes
3 ans
31 views
Class 'DOMDocument' not found

I've found an error on a page in my Magento application; it always show this message error when I visit it: > Fatal error: Class 'DOMDocument'...

php-dev Solved
WS
asked 5 months ago by ws_123
0 votes
3 ans
35 views
How can I get the current script file name, but without the extension ".php"?

If I have PHP script, how can I get the filename of the currently executed file without its extension? Given the name of a script of the form "jquery.j...

php-dev Solved
AL
asked 5 months ago by Alex
0 votes
2 ans
26 views
Where is PHP.ini in Mac OS X Lion?

I wanted to run some PHP right on my Mac, uncommented httpd.conf, activated web sharing, installed MySQL etc. I can't seem to find my PHP files, most impor...

php-dev Solved
OR
asked 5 months ago by Orun
0 votes
3 ans
35 views
How can I sort arrays and data in PHP?

> This question is intended as a reference for questions about sorting arrays in PHP. It is easy to think that your particular case is unique and worthy of a...

php-dev Solved
DE
asked 5 months ago by deceze
0 votes
3 ans
32 views
Simplest way to profile a PHP script

What's the easiest way to profile a PHP script? I'd love tacking something on that shows me a dump of all function calls and how long they took, but...

php-dev Solved
MA
asked 5 months ago by Mark Biek
0 votes
2 ans
32 views
Laravel: How to Get Current Route Name? (v5 ... v7)

In Laravel v4 I was able to get the current route name using... <!-- language: php --> Route::currentRouteName() How can I do it in **Laravel...

php-dev Solved
MD
asked 5 months ago by Md Rashedul Hoque Bhuiyan
0 votes
2 ans
31 views
What is the most accurate way to retrieve a user's correct IP address in PHP?

I know there are a plethora of **$_SERVER** variables headers available for IP address retrieval. I was wondering if there is a general consensus as to how to m...

php-dev Solved
CO
asked 5 months ago by Corey Ballou
0 votes
3 ans
30 views
Convert a comma-delimited string into array of integers?

The following code: $string = "1,2,3" $ids = explode(',', $string); var_dump($ids); Returns the array: array(3)...

php-dev Solved
CW
asked 5 months ago by cwal
0 votes
3 ans
32 views
Only variables should be passed by reference

// Other variables $MAX_FILENAME_LENGTH = 260; $file_name = $_FILES[$upload_name]['name']; //echo "testing-".$file_name.&qu...

general-dev Solved
FR
asked 5 months ago by Frank Nwoko
0 votes
3 ans
28 views
Delete directory with files in it?

I wonder, what's the easiest way to delete a directory with all its files in it? I'm using `rmdir(PATH . '/' . $value);` to delete a folder,...

general-dev Solved
MA
asked 5 months ago by matt
0 votes
2 ans
33 views
How to read if a checkbox is checked in PHP?

How to read if a checkbox is checked in PHP?

php-dev Solved
TH
asked 5 months ago by Thew
0 votes
3 ans
34 views
Are arrays in PHP copied as value or as reference to new variables, and when passed to functions?

1) When an array is passed as an argument to a method or function, is it passed by reference, or by value? 2) When assigning an array to a variable, is the n...

php-dev Solved
FR
asked 5 months ago by Frank
0 votes
3 ans
30 views
How can I prevent XSS with HTML/PHP?

How do I prevent [XSS][1] (cross-site scripting) using just HTML and PHP? I've seen numerous other posts on this topic, but I have not found an article t...

php-dev Solved
TI
asked 5 months ago by TimTim
0 votes
2 ans
32 views
PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

I am getting this error when trying to upload an import on WordPress on my XAMPP local dev environment: Warning: POST Content-Length of 8978294 bytes exceeds...

php-dev Solved
NO
asked 5 months ago by novicePrgrmr
0 votes
2 ans
29 views
How to get first 5 characters from string

How to get first 5 characters from string using php $myStr = "HelloWordl"; result should be like this $result = "Hello";

php-dev Solved
FA
asked 5 months ago by faressoft
0 votes
3 ans
31 views
How to check for null in Twig?

What construct should I use to check whether a value is NULL in a Twig template?

general-dev Solved
FL
asked 5 months ago by Fluffy