LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 17 of 106
0 votes
1 ans
3 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 1 month ago by caw
0 votes
1 ans
3 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 1 month ago by cmcculloh
0 votes
1 ans
3 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 1 month ago by ws_123
0 votes
1 ans
3 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 1 month ago by Alex
0 votes
1 ans
3 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 1 month ago by Orun
0 votes
1 ans
3 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 1 month ago by deceze
0 votes
1 ans
3 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 1 month ago by Mark Biek
0 votes
2 ans
3 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 1 month ago by Md Rashedul Hoque Bhuiyan
0 votes
1 ans
3 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 1 month ago by Corey Ballou
0 votes
1 ans
3 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 1 month ago by cwal
0 votes
1 ans
3 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 1 month ago by Frank Nwoko
0 votes
1 ans
3 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 1 month ago by matt
0 votes
1 ans
3 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 1 month ago by Thew
0 votes
1 ans
3 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 1 month ago by Frank
0 votes
1 ans
3 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 1 month ago by TimTim
0 votes
1 ans
3 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 1 month ago by novicePrgrmr
0 votes
1 ans
3 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 1 month ago by faressoft
0 votes
1 ans
3 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 1 month ago by Fluffy
0 votes
1 ans
3 views
Convert timestamp to readable date/time PHP

I have a timestamp stored in a session (1299446702). How can I convert that to a readable date/time in PHP? I have tried srttotime, etc. to no avail.

php-dev Solved
AD
asked 1 month ago by Adamski
0 votes
1 ans
3 views
How to remove the leading character from a string?

I have a input string like: $str = ':this is a applepie :) '; How can I remove the first occurring `:` with PHP? Desired output: `this is a...

php-dev Solved
YU
asked 1 month ago by yuli chika