Questions tagged as 'php'

3
answers

Define variable according to number-to-number

I have the following idea: $quantidade = $rowcount; if $quantidade (?) '(?)') { $valor = '1'; I need to set the $ value by following: de 100 a 499 = 1 de 500 a 999 = 2 de 1000 a 1499 = 3 de 1500 a 1999 = 4 de 2000 a 3999 = 5 acima de 4000...
asked by 09.05.2018 / 15:21
2
answers

Limit of items in the "foreach"

I have a code that takes the images from the images/FotosdoWhatsAPP folder, but it is displaying all the images, I would like to display only a quantity X (eg 5 images). <?php $dirname = "images/FotosWhatsApp/"; $images = glob($dir...
asked by 20.11.2018 / 23:38
2
answers

How to merge two multidimensional arrays, neglecting repeated values?

I have two multidimensional arrays . An array I am bringing from a .json file , the other is coming from a POST via Ajax . My idea is to generate a new array by merging these two other multidimensional arrays without repeating the data....
asked by 12.09.2017 / 06:31
2
answers

Retrieving string value JSON

I have a PHP application that returns me a string Json : $cep = $_POST['cep']; $token = ''; $url = 'http://www.cepaberto.com/api/v2/ceps.json?cep=' . $cep; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($c...
asked by 25.07.2017 / 22:15
3
answers

Calculate Time Range [duplicate]

I need to calculate the minute interval between two dates. My problem is being calculating when a day goes by. Example: Primeira Data -> 2016-11-18 15:20:00; Segunda Data -> 2016-11-18 15:45:02;     
asked by 18.11.2016 / 19:23
2
answers

What does "new" PHP do when instantiating a class? [closed]

I have a class called Setup with some static methods. But I'm having trouble understanding something that happens. I use the methods of the class as follows: Setup::$getMetodoX so far so good. But for ease of use and not having to in...
asked by 29.11.2016 / 13:30
1
answer

Is there any way to bring information from the database without using server side language?

I was evaluating the Zap Imoveis site to find out which languages and technologies are used on their site. I use Wappalyzer , a Chrome extension that shows the technologies used on any site. Well, I noticed that on that site Wappalyzer did...
asked by 07.09.2017 / 20:52
2
answers

Show animation while loading?

I have not found much about this subject in tutorials, I do not know if anyone else has noticed that services like Facebook, Netflix use a kind of load before showing the content, both seem to work the same way, in some tutorials said that this...
asked by 13.10.2016 / 23:11
4
answers

Character limit

I need to limit characters in a text, and should stick with (...). The title goes out of the layout. if($related){ echo ' <div class="row"> <div class="medium-12 columns"> <div class="ap-ads-related"&...
asked by 01.11.2016 / 09:48
3
answers

How to insert new line in json file, using PHP?

In the snippet of code config.json , I need every time I run a PHP script, it inserts a new line below, with the sequence number and corresponding id: "assignment": { "0": "292", "1": "280",...
asked by 09.05.2018 / 15:50