Questions tagged as 'php'

2
answers

Error installing JWT / Laravel

I'm trying to install JWTAuth in my project. I updated my composer.json as per the documentation: composer.json: "require": { "tymon/jwt-auth": "0.5.*" } I ran the composer update command and had the following error: Prob...
asked by 04.11.2016 / 14:09
2
answers

Group items by month and count them laravel

I need to group and count all items by mês . I use Laravel 5.2 , I tried to do this: $mes = date('m'); $vendas = Encomenda::where('FlgStEncomenda', 'O') ->group("MONTH(created_at)={$mes}") ->count(); I ne...
asked by 23.11.2016 / 18:56
1
answer

Should I use abstract class or interface?

I have a class that connects to Windows machines. I'm leaving it a bit more generic, so I can reuse it for other systems. I was able to identify four "generic" methods: connect status error message run With this, I put together a...
asked by 19.11.2016 / 18:23
1
answer

How to return the expected result in this query?

Good afternoon, guys. The case is as follows: I have a table with 2 blogs of category "automovel" and part of the title "Hackers" then whatever my query, can not return more than two results combining the "title" and "category" . Can you help me...
asked by 19.11.2016 / 15:26
2
answers

Use array_search in a multidimensional array php

In a list of books within a% multidimensional%, every array has a different column category , I would like to search this sub_array for a category > for example: Array "livros" ( [Livro 1] => Array...
asked by 19.11.2016 / 00:45
2
answers

How, after a POST request, receive the JSON return in C #?

I need to have a POST link request, so I also get the json in php . This is the test code in php <?php if(isset($_POST['request'])) { echo $jsonret = '{"request":"sim","name":"'.$_POST['request'].'"}'; }...
asked by 07.11.2016 / 22:31
1
answer

Difference between dates in Months, for interval = 12

To find the difference between two dates, you should use the date_diff () . $datetime1 = date_create('2016-10-11'); $datetime2 = date_create('2018-10-11'); $interval = date_diff($datetime1, $datetime2); return $interval->m; // months T...
asked by 22.11.2016 / 19:00
2
answers

How to remove a part of the string at the beginning or after the space?

I need to change names beginning with HE by E such as HELIANE HELIAS for ELIANE ELIAS But it can be GUILHERME HENRIQUE and switch to GUILHERME ENRIQUE     
asked by 10.08.2016 / 22:34
3
answers

superglobal validation

I'm developing a class to support multiple uploads using the Codeigniter framework and I've decided to parse my code using some online tools. One of these was code climate ; I noticed that when checking the reports for code improvement it...
asked by 09.08.2016 / 16:04
2
answers

CNPJ query using PHP

The situation is as follows, I have a script in PHP that does CNPJ queries through the IRS website, however it is returning some errors, I really do not know if they are errors . HTML / PHP code consulta.html <html>...
asked by 06.04.2016 / 13:48