Questions tagged as 'php'

1
answer

Is there any way to find out an error occurred in json_decode?

Well, PHP has something I sometimes find bad: Some functions throw Warning when some error occurs, and others return False or Null . A case that exemplifies this is fopen . fopen('non-exists.txt', 'r'); Generate...
asked by 26.04.2016 / 18:34
1
answer

When my class returns a new modified instance of the class itself instead of modifying itself is this some design pattern?

I'm developing a class that is a collection of values. In it I have several methods that filter the values contained in this collection. My intention is to return a new instance of this same class depending on the modification that a given metho...
asked by 31.03.2016 / 19:37
2
answers

PHP 5.5 implemented the foreach functionality with list. What are the benefits of this?

In PHP 5.5, we have a new feature, which is to use list together with foreach . $array = [ [1, 2], [3, 4], ]; foreach ($array as list($a, $b)) { echo "A: $a; B: $b\n"; } Output is: A: 1; B: 2 A: 3; B: 4 I unde...
asked by 13.05.2016 / 14:56
1
answer

PHP problem with SQL INT

I am making a form that sends the data by AJAX and then inserts, so far so good. Only the maximum value of INT in SQL is 2147483647, and the field I have has a maximum of 11 digits that can go up to 99999999999, what is the...
asked by 12.05.2016 / 12:28
1
answer

Using the php artisan make: repository command

Hello, I would like to ask a question. I am using the command: php artisan make:repository ProjectNote And I would like to know how to make the command understand that I want my migrate to have the name create_table_project_notes And t...
asked by 06.05.2016 / 21:01
1
answer

Warning: Illegal string offset

I am trying to show in the report the result of a INNER JOIN of 3 tables, I save the 3 values in a array and I make a foreach to go through all the records, but the following error appears:    Warning: Illegal string offse...
asked by 11.05.2017 / 20:29
1
answer

Performance and security PHP x C ++ for web

Today I work in a company that manages some sites with too big traffic, which is causing some server overload problems and so on. These sites are mostly news portals and are running Wordpress, these sites the more they grow in data volume the mo...
asked by 08.05.2017 / 04:51
1
answer

Santander Boleto Registrado via XML

I'm trying to migrate the system to Santander's registered tickets. I was finally able to receive the 2017 manual today. 1 - When I try to access the link to generate a ticket, it says "403 Forbidden"    link 2 - Is it a SOAP request...
asked by 11.05.2017 / 14:37
1
answer

How to convert html texts (entities) into "normal" texts?

In my database are saved rows that are "read" by html, so they are saved with tags and those characters that do not know the name = > &nbsp, &eacute etc .. The problem is that in my application I will use this text to put i...
asked by 18.01.2018 / 19:39
2
answers

Export query result sql server to txt file on apache server automatically

I make the following query from my apache server on a SQL SERVER database: <?php // Dados do banco $dbhost = "192.168.0.100"; #Nome do host $db = "DATABASE"; #Nome do banco de dados $user = "root"; #N...
asked by 16.01.2017 / 15:42