Questions tagged as 'php'

3
answers

How to reuse the connection in the subclass?

Colleagues, I have a connection class: class Conecta { private $Servidor = '127.0.0.1'; private $Usuario = 'root'; private $Senha = 'senha'; private $Banco = 'banco'; // Protegido protected $Conecta; // Faz a cone...
asked by 09.11.2015 / 02:23
2
answers

Separate equal values into an array

Well I have the following array: $produtos2[] = array( "cod" => (int) 768, "nome" => "LOGITECH M535", "GRUPO" => "MOUSE" ); $produtos2[] = array( "cod" => (int) 2334, "nome" => "MULTILASER DECT", "GRUPO"...
asked by 16.03.2018 / 14:52
2
answers

Payment in installments with ticket via PagSeguro [closed]

I developed a site where there is a course for sale at a specific value. This course is available for payment with PagSeguro , for those who pay on the card is quiet, but would have some way to make installments in the ticket? So far, I have...
asked by 15.02.2014 / 14:27
2
answers

How to read comments from a class, function, or method?

I have already seen some implementations in the framework Symfony and Laravel that allow to define through comments routes in controller methods, or Doctrine Models annotation definitions. More or less like this: class Usuariosontroller {...
asked by 17.08.2018 / 19:29
3
answers

OFFSET next to COUNT (*) returns nothing?

When I make an inquiry this way the data is returned correctly (Currently 2 rows): SELECT * FROM noticias ORDER BY data_noticia DESC LIMIT 30 OFFSET 2 But I need to know how many rows this query returns me so intuitively it would look like...
asked by 06.09.2018 / 23:28
4
answers

Know what day falls next Monday

I need a schedule for an agenda that will give me the date of the next Mondays from a certain date Ex: today and day 06/01 I need to know what day the next 10 Mondays will fall. 1 = 05/06/2017 2 = 12/06/2017 3 = 19/06/2017 4 = 26/06/2017 5...
asked by 01.06.2017 / 18:44
4
answers

Remove items from an array that contains only 1 character

I have a following array : $arr = array('estrela', 'não', 'é', 'up','.','Evitem', 'estrelar', 'abobrinha', 'coisa', 'fugaz', 'de', 'interesse', 'praticamente', 'individual', 'conversa mole','.','Só', 'porque', 'é', 'engraçado', 'não','quer','...
asked by 05.03.2017 / 20:36
2
answers

Format the return of the MySQL Now () function

So folks. I need to know if I'm going to just send the hours H: i: s from the NOW() function in the database, or send the NOW() complete and then only search the hours?     
asked by 13.07.2015 / 19:28
2
answers

What are the differences between __autoload and spl_autoload_register?

In php, we have two methods of doing autoload of classes: function __autoload Example: function __autoload($class_name) { require_once $class_name . '.php'; } $obj = new MyClass1(); $obj2 = new MyClass2(); function spl_au...
asked by 16.07.2015 / 17:29
3
answers

What's the difference between these 2 PHP codes?

I'm studying PHP and I came across the following question: what would be the difference between the following codes: <?php class ClasseTeste { protected $db_host = 'localhost'; protected $db_user = 'root'; protected $db_pass = '...
asked by 14.05.2015 / 17:05