366 solutions found in php-dev
Page 11 of 19votes
<?php $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $from =...
votes
I am trying to convert a date from `yyyy-mm-dd` to `dd-mm-yyyy` (but not in SQL); however I don't know how the date function requires a timestamp, and I can...
votes
I'm trying to connect to a Tor hidden service using the following PHP code: $url = 'http://jhiwjjlqpyawmpjx.onion/' $ch = curl_init();...
votes
How do I convert the value of a PHP variable to string? I was looking for something better than concatenating with an empty string: $myText = $myVar ....
votes
I need a really, really fast method of checking if a string is JSON or not. I feel like this is not the best way: function isJson($string) { ret...
votes
I was diving into Symfony framework (version 4) code and found this piece of code: $env = $_SERVER['APP_ENV'] ?? 'dev'; I'm not su...
votes
Here's the information [according to the official documentation][1]: > There are four different pairs of > opening and closing tags which can be...
votes
I have a PHP file that is sometimes called from a page that has started a session and sometimes from a page that doesn't have session started. Therefore whe...
votes
I can't figure out how to add a new column to my existing database table using the Laravel framework. I tried to edit the migration file using... <...
votes
I wish to get the file extension of an image I am uploading, but I just get an array back. $userfile_name = $_FILES['image']['name'];...
votes
How can I convert an array like this to an object? ``` [128] => Array ( [status] => "Figure A. Facebook's horizontal scrollba...
votes
I am struggling to run a single test method named `testSaveAndDrop` in the file `escalation/EscalationGroupTest.php` with `phpunit`. I tried the following combi...
votes
with a new array I do this: $aVal = array(); $aVal[key1][var1] = "something"; $aVal[key1][var2] = "something else";...
votes
Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could forc...
votes
When debugging in PHP, I frequently find it useful to simply stick a [var_dump()][1] in my code to show me what a variable is, what its value is, and the same f...
votes
How would it be possible to generate a random, unique string using numbers and letters for use in a verify link? Like when you create an account on a website, a...
votes
I need to enable *pdo_mysql* in my [EasyPHP][1] environment, so I went to the *php.ini* file and uncommented the following line: extension=php_pdo_mysql....
votes
I am trying to decode a JSON string into an array but i get the following error. > Fatal error: Cannot use object of type stdClass as array Here is the...
votes
I'm checking out some `PHP 5.3.0` features and ran across some code on the site that looks quite funny: public function getTotal($tax) {...
votes
I tried to parse a JSON file using PHP. But I am stuck now. This is the content of my JSON file: ```json { "John": { "status":&q...