Questions tagged as 'php'

1
answer

Do a HasMany by date with Laravel 5.3?

Is there any way to do HasMany by bringing records by date? public function despesas() { return $this->hasMany(Despesa::class); //registros apenas desse mês } I tried to use the following but did not scroll: public functio...
asked by 22.11.2016 / 11:38
2
answers

What is the best way to create a mobile application that communicates with a Webserver?

I'm developing a mobile application that should contain the same site content, and the same database ( MySQL mobile application. I believe that creating a direct connection from the mobile mobile to the remote database would be a securi...
asked by 01.12.2015 / 17:52
1
answer

Is there a way to do these assignments more cleanly?

I have a class that should be started with a% of properties. $subscription = new CheckRenew([ 'custom_2_id' => 13, 'email' => '[email protected]', 'zip' => '90530000', 'number' => '1234' ]);...
asked by 29.12.2016 / 20:04
1
answer

Which correct way to add two fields

Good evening friends, what is the correct way to add these two value-dependent and adesao fields and display the total value in the input. Adesao = 3.500.33; Dependents = 90.33; Total Correct: 3.590,66 Code <?php...
asked by 09.01.2017 / 23:53
2
answers

Function to generate INI from Array

Is there a function that does the inverse of parse_ini_file in order to generate a configuration file from an array?     
asked by 31.03.2014 / 19:51
2
answers

Generate UML of PHP code

Is there any software, preferably opensource, that manages the UML of a code already written in PHP? The annoying thing is having to update the diagram every time the code is updated.     
asked by 26.03.2014 / 04:43
2
answers

Error Deprecated: Function ereg ()

In script that I installed gave this error:    Deprecated: Function ereg () is deprecated in /home/u844214382/public_html/functions.php on line 98 Deprecated: Code on line 98: if (ereg("^[a-zA-Z0-9\-_]{3,20}$", $mensaje)) { There...
asked by 05.04.2014 / 00:27
1
answer

How to validate form's origin?

I have a web application in which there is a login and registration form, and from what I realized I can download the HTML from my site and send the request through my PC pointing to the site, so how do I check the origin of the form?     
asked by 20.03.2016 / 03:08
2
answers

Register data in a foreign key table

I'm trying to register a user but in his table there is a foreign key attached to another table. My problem is that this foreign key is referencing the address table, but I do not yet have an address for this user, I want it to be able to reg...
asked by 25.03.2016 / 08:21
1
answer

Mount a two-dimensional array from another array

I have the array $dados below: array(5) { [0]=> "2018-03-28" [1]=> "jantar" [2]=> "lanche" [3]=> "2018-03-29" [4]=> "lanche" } From this array, how could I mount another two-dimensional array so that it...
asked by 27.03.2018 / 21:48