LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

366 solutions found in php-dev

Page 7 of 19
0 votes
1 ans
3 views
Cross-Origin Request Headers(CORS) with PHP headers

I have a simple PHP script that I am attempting a cross-domain CORS request: <?php header("Access-Control-Allow-Origin: *"); heade...

php-dev Solved
US
asked 1 month ago by user1022241
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
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
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
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
0 votes
1 ans
3 views
How can I send an email using PHP?

I am using PHP on a website and I want to add emailing functionality. I have [WampServer][1] installed. How do I send an email using PHP? [1]: https:...

php-dev Solved
US
asked 1 month ago by user590849
0 votes
1 ans
3 views
Tracking the script execution time in PHP

PHP must track the amount of CPU time a particular script has used in order to enforce the max_execution_time limit. Is there a way to get access to this i...

php-dev Solved
TW
asked 1 month ago by twk
0 votes
1 ans
3 views
Interface or an Abstract Class: which one to use?

Please explain when I should use a PHP `interface` and when I should use an `abstract class`? How I can change my `abstract class` in to an `interface`?

php-dev Solved
US
asked 1 month ago by user220758