Questions tagged as 'php'

1
answer

Send data in json format to php

I know that sending json from PHP to JS is totally viable, but is it possible to send my data via json ajax to PHP?     
asked by 18.12.2015 / 12:05
2
answers

Multiple regular expressions in a string with bars

I need a regular expression that matches the end of a URL in the following format: /somente-letras/somente-numeros[/] To combine the part of somente-letras , I used ~^/[A-Z]+$~ , however from the moment I put a bar, nothing else...
asked by 16.12.2015 / 17:28
1
answer

What is the maximum amount an array can support in PHP?

In PHP I usually work a lot with frameworks. Generally, they even bring query results to a database in array . In some cases, when the number of data in a table or a relationship reaches a very large level, if we do not use features lik...
asked by 24.02.2016 / 13:05
1
answer

Return duplicate values in arrays

My question is the following? I have the following array: $array1 = array(10, 50, 80, 40, 90); $array2 = array(10, 30, 10, 40, 20); $array3 = array(10, 60, 15, 40, 30); $array4 = array(20, 30, 40, 10, 50); $array5 = array(10, 05, 10, 90, 40);...
asked by 29.08.2016 / 19:57
1
answer

Connection with WebService SOAP WSDL with XML return

I have the following code that works perfectly. The webservice return is XML , but the return I'm getting is a string. What should I do to get XML as a return and not a string? $client = new SoapClient('http://www.roveri.inf.br/ws...
asked by 30.01.2017 / 13:23
1
answer

What is the difference between exec (), system () and passthru ()?

What are the differences between these functions? Is there a specific situation to use each function? If it exists, give examples of these situations.     
asked by 26.05.2017 / 16:22
1
answer

Is it incorrect to change the arguments in an extended classes in PHP?

Is it incorrect (or "semantically incorrect") to change the arguments in an extended classes in PHP? For example I created this class: class Bar { public function __construct($message, $code, $timer) { var_dump($message, $co...
asked by 30.12.2016 / 23:00
2
answers

Best practice for client to choose response format (JSON / XML)

I would like to know the best coding practice that allows the client to define the response format for the request he made, which can also include filters, conditions, ordering, etc. I made a small template for the answer, I do not know if it...
asked by 16.01.2017 / 14:59
1
answer

Remove comment lines from TXT files

I would like to know how to remove comment tags from TXT files with PHP , could anyone help me? I'm having this problem reading txt files that are displaying the comments. PHP code: function extrairDadosNotificacao($NomeArquivo){...
asked by 03.01.2018 / 16:49
1
answer

Access properties without knowing name

Is it possible within the class to access all your (properties) definitions without having their names? For example, if I create an instance of a class $classe = new Classe() , and I'm defining things in it: $classe->ComprarFile...
asked by 13.10.2015 / 03:18