Questions tagged as 'php'

2
answers

Return data from a php server using AJAX

Greetings, I am doing a simple test, it is about sending a data through AJAX to PHP so that I can return a data, but I do not know why it does not return any data. The JavaScript code is as follows: $(document).ready(function(){ $("#l...
asked by 19.09.2017 / 01:13
5
answers

What is more effective? For or Foreach in PHP

Some time ago I have been programming in php. And I had the following doubt regarding the efficiency of the resources and the speed of how they behave. My question is this: What function is more effective when traversing an array? I w...
asked by 27.04.2017 / 17:19
2
answers

How to send two data with Laravel lists?

I want to send 2 values to the view with lists of laravel admin.horarios.create The question is this, I have this code: public function create() { $docente = Docente::orderBy('nombre','ASC') ->...
asked by 02.12.2016 / 04:56
1
answer

Configure locales in PHP

I have the following code: <?php $date = new DateTime($uh->updated_at); echo $date->format('d/M/Y'); ?> I need to generate the date, based on the value of a variable. And that this is generated in Spanish. I tried the foll...
asked by 29.07.2017 / 00:17
2
answers

If you send me a URL in the GET redirect to that URL

As the title of the post says if you send me a url I want to redirect to that url . How would you do it completely? if (isset($_GET["URL"])) { header("Location: public_area.php?url=$actual_link"); }     
asked by 10.02.2016 / 21:59
3
answers

Difference between two php arrays?

I have two arrays: A1 and B1 . How do I compare them and find those records in the first array that have some difference from the second? $a1 = Array ( "0" => Array ( "Empresa" => "HHH", "P...
asked by 29.01.2016 / 21:12
2
answers

What charset should I use when I send an email through PHP?

Use this charset : $mailHeader2 .= "Mime-Version: 1.0 \r\n"; $mailHeader2 .= "Content-Type: text/html; charset=utf-8";     
asked by 29.01.2016 / 21:00
4
answers

Inner join query to display the name with the id in two PHP tables

I have two tables, one call articulos , and another call categorias . In table articulos a column called id_categoria saves the ID of the categories available in the table categorias , and I want to show by the...
asked by 20.12.2018 / 04:11
3
answers

Sort by date an array of files

I have a small PHP script to view the folder files on the server, but first I need to sort the files by the most recent and I do not know where to place the asort in the code below: if($folder) { if(strstr($folder,'..')) exit(ERROR_MESAGE);...
asked by 23.01.2016 / 03:38
2
answers

Obtain records from the previous day

What friends do I need to return the records of the previous day in CodeIgniter, what is the correct way to do it? Here is the code in my model: public function getOrdenes(){ $this->db->where("fecha", date("Y-m-d")); $this->...
asked by 31.08.2018 / 16:35