366 solutions found in php-dev
Page 7 of 19votes
I have a simple PHP script that I am attempting a cross-domain CORS request: <?php header("Access-Control-Allow-Origin: *"); heade...
votes
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?
votes
<?php $a=1; ?> <?=$a;?> What does `<?=` mean exactly?
votes
I have to generate a xml file dynamically at runtime. Please help me in generating the below XML file dynamically using PHP. <?xml version="1...
votes
Is there a way of using an 'OR' operator or equivalent in a PHP switch? For example, something like this: switch ($value) { case 1...
votes
Is it possible to have a function with two returns like this: function test($testvar) { // Do something return $var1; return...
votes
When I run a `composer update` I get this error message: Loading composer repositories with package information Updating dependencies (including req...
votes
What are the differences between `composer update` and `composer install`?
votes
Consider these 2 examples... $key = 'jim'; // example 1 if (isset($array[$key])) { // ... } // example 2...
votes
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...
votes
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...
votes
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...
votes
I'm using CURL to get the status of a site, if it's up/down or redirecting to another site. I want to get it as streamlined as possible, but it's no...
votes
Is there a simple way to convert one date format into another date format in PHP? I have this: $old_date = date('y-m-d-h-i-s'); //...
votes
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...
votes
Is it possible, in PHP, to flatten a (bi/multi)dimensional array without using recursion or references? I'm only interested in the values so the keys can...
votes
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...
votes
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:...
votes
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...
votes
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`?