Questions tagged as 'php'

1
answer

Validation in Laravel

I'm using Form Request Validation to validate a form, but when I leave a field of type required blank no error is generated. How do I generate an error when validation fails? class SaleRequest extends FormRequest { public f...
asked by 12.08.2017 / 03:03
2
answers

Leaking memory in PHP

Leaking memory leaky occurs when a computer program mismanages memory allocation in such a way that memory that is no longer needed is not released. I'd like to understand how memory leakyng can occur in PHP? How could I "debug" to fix me...
asked by 16.08.2017 / 13:52
1
answer

Access array elements from JSON

I'm retrieving an object and turning this object into array . Now, I need to access some elements of this array to populate this data in the controller (CodeIgniter), before returning it as JSON. For the object below: { "contratos"...
asked by 15.08.2017 / 04:14
2
answers

Check if there is a record in the table

I'm trying to check if there is a record in the mysql table using php, I have the table "slug", and in this table I have "id" and "slug_name", as I do to check if there is already a name in this table, for example: noticia_sobre_o_tempo. how...
asked by 24.07.2017 / 15:17
1
answer

Form validation of CodeIgniter does not allow accents and other "br" characters

I'm using the alpha_numeric_spaces rule to validate letters and numbers with space, but when I use any special characters or letters like "ç", validation does not pass, is there any way around this or only by creating a special rule? Ex:...
asked by 20.07.2017 / 22:37
1
answer

How to autocomplete php tag in netBeans?

I'm a beginner in PHP and would like to know how to do netBeans autocomplete the tag <?php ?> because every time I have to write the whole tag and this is filling me up (in SublimeText it writes, only I prefer NetBeans because it di...
asked by 26.07.2017 / 15:35
1
answer

Microsoft Azure - php

How do I get Microsoft Azure to capture my errors? I'mcurrentlyhandlingerrorswiththisfunction:<?php/**PluginName:TESTEDescription:testandolognovoVersion:1.0Author:VtesteAuthorURI:teste-------LICENSE:Thisfileissubjecttothetermsandcondition...
asked by 09.06.2017 / 20:34
1
answer

How to send JSON to PHP?

How do I send this object by ajax , and read in php ?    //Aquicriooobjetocomosinputsvarobj=newObject();varobjectsRadio=$('input:checked').map(function(i){obj.id_varejo=id_varejo;obj.id_pesquisa=idPesquisa;obj.id_pergunta=$(this)...
asked by 01.08.2017 / 19:55
1
answer

Access information in Multidimensional Associative Array (PHP)? [duplicate]

I have the following structure: $arrDados = Array ( [0] => Array ( [NumeroEmpenhoNumero] => Array ( [type] => NULL [size] => 0 [deci] => 0 [code] => 0...
asked by 21.05.2017 / 03:07
1
answer

Strange behavior of the rand () function

By setting the documentation echo rand() // Imprime algo completamente aleatório echo rand($min, $max) // Imprime algo em um range entre min e max In a code, inside a loop, I accidentally generated the following rand($max, $min) I...
asked by 24.05.2017 / 10:46