Questions tagged as 'php'

1
answer

What is the purpose of implementing a magic __invoke method in a class?

I know what the __invoke method is for. It is for a class to perform an action, if called as a function. In addition, it is present in the special class of php called Closure , which is instantiated when we call the anonymous fu...
asked by 02.02.2016 / 17:59
3
answers

Match php variable to a javascript variable

I'm trying to do something like this: <script type="text/javascript"> function guardar_alteracoes(){ <?php $nome = ?>$('#nome').val();<?php; ?> } </script> That is, I want to giv...
asked by 11.07.2014 / 15:16
5
answers

Number of weeks in a month

I would like to know how to calculate the number of weeks that have a month D S T Q Q S S 1 => Semana 1 2 3 4 5 6 7 8 => Semana 2 9 10 11 12 13 14 15 => Semana 3 16 17 18 19 20 21 22 =>...
asked by 20.08.2014 / 14:41
3
answers

Where to create your own class, and how to instantiate it later?

I have a class of its own (i.e. external to the standard libraries of PHP and Laravel) that makes some connections with equipment of my network and in addition I need to create notifications routines by email and SMS. For reference, this is...
asked by 15.01.2014 / 19:17
3
answers

Execute PHP function asynchronously

Using PHP, is it possible to perform a function asynchronously? Example: The client makes a request to the server, in this request PHP executes an asynchronous function that can take a few seconds, but before it finishes, the server respon...
asked by 01.08.2014 / 13:51
2
answers

Using $ _REQUEST instead of $ _GET, $ _POST, and $ _COOKIE

In PHP we have the global variable $_REQUEST that can be used instead of use the global variables $_GET , $_POST and $_COOKIE . For example: <?php // utilizar $bubu = $_REQUEST['bubu']; // ou uma das...
asked by 16.10.2014 / 12:43
6
answers

How to get distance given the coordinates using SQL?

I'm making a function in php , in which, given a GPS coordinate, it will search the database for registered locations, which are not necessarily fixed, within a certain distance. My question is: how do I calculate the distance between the co...
asked by 13.03.2014 / 13:19
4
answers

How do I know if the date is the last day of the month?

I have a date saved in the database, and before I show it on the grid, I need to know if it's the last day of the month. I need this information to present it in a different color.     
asked by 18.08.2016 / 02:03
2
answers

What is the difference between die, exit and __halt_compiler?

What are the main differences between die , exit and __halt_compiler ?     
asked by 02.07.2015 / 17:46
2
answers

Data received from HTTPS is encrypted?

If I install SSL and use HTTPS on my site, for example, I run a POST form, the form data arrives encrypted to the server? If yes, how to decrypt using PHP?.     
asked by 07.02.2015 / 04:33