LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 13 of 106
0 votes
1 ans
3 views
I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?

I'm starting with a date `2010-05-01` and ending with `2010-05-10`. How can I iterate through all of those dates in PHP?

php-dev Solved
SH
asked 1 month ago by Shamoon
0 votes
1 ans
3 views
What does '<?=' mean in PHP?

&lt;?php $a=1; ?&gt; &lt;?=$a;?&gt; What does `&lt;?=` mean exactly?

php-dev Solved
US
asked 1 month ago by user198729
0 votes
1 ans
3 views
How to generate XML file dynamically using PHP?

I have to generate a xml file dynamically at runtime. Please help me in generating the below XML file dynamically using PHP. &lt;?xml version=&quot;1...

php-dev Solved
MU
asked 1 month ago by musicking123
0 votes
1 ans
3 views
How to use a switch case 'or' in PHP

Is there a way of using an &#39;OR&#39; operator or equivalent in a PHP switch? For example, something like this: switch ($value) { case 1...

php-dev Solved
AL
asked 1 month ago by alex
0 votes
1 ans
3 views
PHP - SSL certificate error: unable to get local issuer certificate

I&#39;m running PHP Version 5.6.3 as part of XAMPP on Windows 7. When I try to use the Mandrill API, I&#39;m getting the following error: &gt; Uncaught ex...

server-admin Solved
DO
asked 1 month ago by Dor Dadush
0 votes
1 ans
3 views
Multiple returns from a function

Is it possible to have a function with two returns like this: function test($testvar) { // Do something return $var1; return...

php-dev Solved
VI
asked 1 month ago by vincent
0 votes
2 ans
3 views
PHP error: "The zip extension and unzip command are both missing, skipping."

When I run a `composer update` I get this error message: Loading composer repositories with package information Updating dependencies (including req...

php-dev Solved
B8
asked 1 month ago by b85411
0 votes
1 ans
3 views
What are the differences between composer update and composer install?

What are the differences between `composer update` and `composer install`?

php-dev Solved
DA
asked 1 month ago by Dawlatzai Ghousi
0 votes
1 ans
3 views
What's quicker and better to determine if an array key exists in PHP?

Consider these 2 examples... $key = &#39;jim&#39;; // example 1 if (isset($array[$key])) { // ... } // example 2...

php-dev Solved
AL
asked 1 month ago by alex
0 votes
1 ans
3 views
Good PHP ORM Library?

Is there a good object-relational-mapping library for PHP? I know of [PDO][1]/ADO, but they seem to only provide abstraction of differences between database...

php-dev Solved
SG
asked 1 month ago by sgibbons
0 votes
1 ans
3 views
How to comment in laravel .env file?

I am working on a project in Laravel where I am storing some settings in .env file setting like few parameters for testing purpose and few parameters are for li...

php-dev Solved
AK
asked 1 month ago by Akshay Khale
0 votes
1 ans
3 views
Running Composer returns: "Could not open input file: composer.phar"

I am new to symfony2 and reading [symblog][1]. In third chapter while trying with data-fixtures I tried the command: `php composer.phar update` but I go...

php-dev Solved
US
asked 1 month ago by user3291745
0 votes
1 ans
3 views
Getting HTTP code in PHP using curl

I&#39;m using CURL to get the status of a site, if it&#39;s up/down or redirecting to another site. I want to get it as streamlined as possible, but it&#39;s no...

php-dev Solved
AA
asked 1 month ago by Aaran McGuire
0 votes
1 ans
3 views
On delete cascade with doctrine2

I&#39;m trying to make a simple example in order to learn how to delete a row from a parent table and automatically delete the matching rows in the child table...

general-dev Solved
RF
asked 1 month ago by rfc1484
0 votes
1 ans
3 views
Convert one date format into another in PHP

Is there a simple way to convert one date format into another date format in PHP? I have this: $old_date = date(&#39;y-m-d-h-i-s&#39;); //...

php-dev Solved
TO
asked 1 month ago by Tom
0 votes
1 ans
3 views
Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted

I am trying to add HWIOAuthBundle to my project by running the below command. composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug...

php-dev Solved
BR
asked 1 month ago by Brian Chen
0 votes
1 ans
3 views
How to Flatten a Multidimensional Array?

Is it possible, in PHP, to flatten a (bi/multi)dimensional array without using recursion or references? I&#39;m only interested in the values so the keys can...

php-dev Solved
AL
asked 1 month ago by Alix Axel
0 votes
1 ans
3 views
Download File to server from URL

Well, this one seems quite simple, and it is. All you have to do to download a file to your server is: file_put_contents(&quot;Tmpfile.zip&quot;, file_ge...

server-admin Solved
XA
asked 1 month ago by xaav
0 votes
1 ans
3 views
What is the difference between the | and || or operators?

I have always used `||` (two pipes) in OR expressions, both in C# and PHP. Occasionally I see a single pipe used: `|`. What is the difference between those two...

general-dev Solved
GL
asked 1 month ago by GloryFish
0 votes
1 ans
3 views
Laravel - Eloquent or Fluent random row

How can I select a random row using Eloquent or Fluent in Laravel framework? I know that by using SQL, you can do order by RAND(). However, I would like to g...

php-dev Solved
DI
asked 1 month ago by DigitalWM