Skip to content
Advertisement

php Setting background image randomly from folder

I am trying to randomly set the background image of a webpage from a folder via PHP. I have the following code: Note: the printing of the files is just to ensure I reach that point in code and to see what the files are called. I found a similar question here: Random Background Image PHP but when I used

PHP load json data, output is empty

I try to load data from my JSON file into php see my code below JSON: PHP: If I run this code my output is empty. Who can help me in the right direction? Answer Your JSON input is NOT valid according to RFC 4627 (JSON specification). So the correct json string must be: so your code would work: Or

SSL Certificate with PHP CURL

I’m using curl to send an xml file over https to the rightmove API – they supplied me with all the certificates. I am getting the error : 60SSL certificate problem: unable to get local issuer …

php7 fpm sock file ownership on service restart

I have just installed PHP7 https://github.com/kasparsd/php-7-debian Everything works except each time I do service php7-fpm restart I need manually to set ownership on file /run/php7-fpm.sock to www-data After setting the permissions everything works.. But how to avoid this on every restart? The ownership is always root after restart php-fpm.ini Answer Ownership of the file socket is determined by the listen.owner

Datetime to Timestamp in milliseconds in PHP

I would like to create a timestamp in milliseconds from the input ‘2016-03-22 14:30’. Also the timezone specified should be Australia/Sydney. I’ve tried different approaches but none seem to be working. Can anyone help me please? I’m really struggling with that. Answer Pretty self explanatory code, so I wont say much. If you want to display it properly.

Div text won’t show up as it should

I have a problem with my div, when I’m trying to put text inside a div using <?php echo $uin->text; ?> it doesn’t show up like I want it to. So if it worked it should have looked like this: but for me it always shows up like this Here is the codes I’ve tried: So I don’t know what

Advertisement