LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 9 of 106
0 votes
1 ans
3 views
How do I make a request using HTTP basic authentication with PHP curl?

I'm building a REST web service client in PHP and at the moment I'm using curl to make requests to the service. How do I use curl to make authenticat...

php-dev Solved
BL
asked 1 month ago by blank
0 votes
1 ans
3 views
How can I echo or print an array in PHP?

I have this array Array ( [data] => Array ( [0] => Array ( [page_id] => 204725966262...

php-dev Solved
EN
asked 1 month ago by EnexoOnoma
0 votes
1 ans
3 views
How can I add a PHP page to WordPress?

I want to create a custom page for my WordPress blog that will execute my PHP code in it, whilst remaining a part of the overall site CSS/theme/design. The P...

php-dev Solved
CI
asked 1 month ago by citronic
0 votes
1 ans
3 views
How to convert array to SimpleXML

How can I convert an array to a SimpleXML object in PHP?

php-dev Solved
MI
asked 1 month ago by Mike
0 votes
1 ans
3 views
Test if number is odd or even

What is the simplest most basic way to find out if a number/variable is odd or even in PHP? Is it something to do with mod? I've tried a few scripts but...

general-dev Solved
US
asked 1 month ago by user1022585
0 votes
1 ans
3 views
How do I create a simple 'Hello World' module in Magento?

How can the following be accomplished in Magento? - Display a "Hello World" message using a controller/view/model approach. So, if I went to `http:...

general-dev Solved
AL
asked 1 month ago by Ali
0 votes
1 ans
3 views
Switch php versions on commandline ubuntu 16.04

I have installed php 5.6 and and php 7.1 on my Ubuntu 16.04 I know with Apache as my web server, I can do a2enmod php5.6 #to enable php5 a2enmod...

server-admin Solved
SA
asked 1 month ago by salimsaid
0 votes
1 ans
3 views
What do strict types do in PHP?

I've seen the following new line in PHP 7, but nobody really explains what it means. I've googled it and all they talk about is will you be enabling it...

php-dev Solved
SU
asked 1 month ago by sufuko
0 votes
1 ans
3 views
How to extract and access data from JSON with PHP?

> This is intended to be a general reference question and answer covering many of the never-ending *"How do I access data in my JSON?"* questions....

php-dev Solved
US
asked 1 month ago by user3942918
0 votes
1 ans
3 views
How to save an HTML5 Canvas as an image on a server?

I'm working on a generative art project where I would like to allow users to save the resulting images from an algorithm. The general idea is: * Create a...

server-admin Solved
NA
asked 1 month ago by nathan lachenmyer
0 votes
2 ans
5 views
How to get name of calling function/method in PHP?

I am aware of function `debug_backtrace`, but I am looking for some ready to use implementation of function like `GetCallingMethodName()`? It would be perfect i...

php-dev Solved
DA
asked 1 month ago by Dawid Ohia
0 votes
1 ans
3 views
Getting the first character of a string with $str[0]

I want to get the first letter of a string and I've noticed that `$str[0]` works great. I am just not sure whether this is 'good practice', as that...

php-dev Solved
TA
asked 1 month ago by Tatu Ulmanen
0 votes
1 ans
3 views
"Keep Me Logged In" - the best approach

My web application uses sessions to store information about the user once they've logged in, and to maintain that information as they travel from page to pa...

general-dev Solved
MA
asked 1 month ago by Matthew
0 votes
1 ans
3 views
require(vendor/autoload.php): failed to open stream

I know that this issue has been posted many times, but for me it seems to be a different problem. Indeed, this error > Warning: require(vendor/autoload.ph...

php-dev Solved
AD
asked 1 month ago by adrTuIPKJ44
0 votes
1 ans
3 views
Simplest PHP example for retrieving user_timeline with Twitter API version 1.1

Because of the Twitter API 1.0 retirement as of [June 11th 2013](https://dev.twitter.com/blog/api-v1-retirement-date-extended-to-june-11), the script below does...

php-dev Solved
FE
asked 1 month ago by fellowworldcitizen
0 votes
1 ans
3 views
How to validate an email address in PHP

I have this function to validate an email addresses: function validateEMAIL($EMAIL) { $v = "/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/&quot...

php-dev Solved
CA
asked 1 month ago by Cameron
0 votes
1 ans
3 views
Why check both isset() and !empty()

Is there a difference between `isset` and `!empty`. If I do this double boolean check, is it correct this way or redundant? and is there a shorter way to do the...

general-dev Solved
SI
asked 1 month ago by silow
0 votes
1 ans
3 views
What is the size limit of an HTTP POST request?

Sorry if this is duplicate,I would think it would be but couldn't find anything. I have a flex application that I am posting data back to a PHP/MySQL ser...

general-dev Solved
IN
asked 1 month ago by invertedSpear
0 votes
1 ans
3 views
Visual Studio Code PHP Intelephense keeps showing a not existing error

After the latest update of PHP Intelephense that I get today, Intelephense keeps showing an error for an undefined symbol for my route (and other classes too)....

php-dev Solved
AD
asked 1 month ago by Adrian Edy Pratama
0 votes
1 ans
3 views
How to remove /public/ from a Laravel URL

I want to remove the `/public/` fragment from my Laravel 5 URLs. I don't want to run a VM, this just seems awkward when switching between projects. I...

php-dev Solved
US
asked 1 month ago by user1537360