Questions tagged as 'php'

3
answers

Array passing as a parameter of a function

I want to get the array containing the numbers 3, 15 and 23 and with an output array display twice. But it is giving the following error:   Warning: Missing argument 1 for creating_array (), called in <?php function criando_array($...
asked by 04.03.2015 / 02:56
3
answers

What is a "__contruct ()" method?

I'm starting studies on OOP, and I came across the following method: <?php class ShopProduct { public $title = "default product"; public $producerMainName = "main name"; public $producerFirstName = "first name"; public $pric...
asked by 16.11.2016 / 14:03
3
answers

Split into two parts when it contains more than one delimiter in the exploded string

$produto = "Leite Pasteurizado, Mucuri, Integral, 1 L"; $prod = explode(" ", $produto); $prod[0]; //tipo_produto = Leite $prod[1]; //marca_produto = Pasteurizado, Mucuri, Integral, 1 L I need to prod[1] save the entire sting, including...
asked by 12.02.2016 / 20:44
3
answers

How to fill a value object automatically in php?

I need a method that autocompletes my VO by getting a result set from the mysql database and the PDO class from php as a parameter. Example VO class Pessoa{ public $nome; public $idade; } The idea is to incorporate this fill...
asked by 09.05.2014 / 21:05
1
answer

How to send and process N distinct forms with ajax without giving refresh on the page?

How to do it when you have n forms with the same ID , or CLASS send the data to process and when you finish processing change the color of <'tr bgcolor="#FFFF00"'> to green '#00FF00' signaling that the process h...
asked by 30.05.2014 / 02:31
3
answers

SQL ordering only after the third character

I have a field in my MySQL table that is of type string, with the following data: Coluna 01DV 03DV 04DV If you enter the value 02CA the farm field thus Coluna 01DV 02CA 03DV 04DV I need it to look like this: Coluna 02CA 01DV 0...
asked by 03.07.2014 / 01:28
2
answers

open new window php

On the site I have several banner ads. When I click on a banner, I'm redirected to a page that counts clicks on the banner. After this count I'm redirected to the page before the click on the banner and a new tab with the banner link opens. For...
asked by 11.08.2014 / 12:30
1
answer

How to limit the number of pages displayed on a page?

With this question that already has a workaround, I got as a result a paginação com PDO but I have one more problem that will possibly be the target of a reward next week. As you can see in the image below, I have this page with +...
asked by 03.10.2014 / 22:03
2
answers

Generate unique color for each result

So .. I have a system of comments anonymously in a project of mine that in place of the avatar it puts the abbreviation of the name of the person, for example: Vinicius Eduardo -> VE and I want to create a system or function that generat...
asked by 19.06.2014 / 03:28
1
answer

PHP says that two equal strings have different lengths

I'm trying to compare two strings, but something unusual happens. I have the code: <?php $char = 'Á'; var_dump('Á'); var_dump($char); The variable $char receives 'Á' and the result is as follows. string 'Ã' (length=2)...
asked by 21.07.2014 / 10:08