Questions tagged as 'php'

2
answers

Copy all files and directories to a destination in Php

I need to copy a route to another route, taking into account all files and directories in the first route, similar to the xcopy command I only know the function copy , is there a function in PHP that does it recursively?...
asked by 08.06.2016 / 15:59
4
answers

Problems with the $ _GET

I have this code and a value in the url that I call with the function: $ _GET (called cID = (Number)) I'm stuck and I can not make the query I do with the json, the only way it works is adding the number manually, but I need you to take it from...
asked by 15.06.2016 / 18:01
3
answers

How to show local time with PHP?

Try the following script: <?php $hora = date("G:a"); echo $hora; ?> Select the G format to print the time without the initial 0, but print me 14: pm and on my computer it's 11: am, how do I synchronize php with my local time?     
asked by 09.06.2016 / 16:26
3
answers

Check if a string is a date in PHP

I am receiving two dates from a form, I am in the validation process on the server. How do I validate the string if it is a valid date? I have now decomposed the date in an array $fecha_array = explode('-', $fecha); and I have highlighted...
asked by 02.01.2019 / 18:08
3
answers

Compare two dates with PHP

I would like to compare two dates, but not only with the year, month and day information, also with the time. I'm trying with: $datetime1 = date_create('2009-10-11 19:10'); $datetime2 = date_create('2009-10-13 18:23'); $interval = date_diff...
asked by 26.03.2017 / 17:30
1
answer

How can I adjust the cells of this FPDF document?

Greetings, I am trying to adjust this FPDF document (the header of each column) but I can not find it, I do not find where I have to adjust so that they appear next to each other after the 4th one throws it down. <?php require(...
asked by 22.08.2017 / 07:44
1
answer

Search in a field a specific data of the database?

I try to select a specific data in a field of the database, in this case I have a field that is called idDepto and it has stored the values 3,4,5,6,7,8 but when executing the query: $sql = "SELECT Correo, idDepto, Notificacion...
asked by 10.08.2017 / 15:47
2
answers

Remove duplicates in an array of objects in PHP

I have an array of objects and I wanted to know if there is any way to eliminate the duplicates. array_unique() does not detect it. The solution that works for me is to go through it, take ["tagname"] from another array, elimin...
asked by 30.08.2017 / 10:45
2
answers

Send phrase to web service using JSON

I have a small problem when sending a phrase using JSON to a web service, if I send a string without spaces like String name="Jose" ;, there is no problem, but when trying to send a whole sentence, the consultation is not done. What would be the...
asked by 09.12.2018 / 22:48
2
answers

how to set up htaccess to be able to embed .php in HTML files

I have a web in html, css and javascript (without libraries or framework) and I need to embed footer and external header to make it easier to maintain. I found the following code that would solve it, but they clarify that, if it does not work, t...
asked by 13.12.2018 / 12:18