Questions tagged as 'php'

4
answers

Why CakePHP arrows _method equal to PUT instead of POST?

I recently updated my CakePHP project to version 2.4.5. Since then, some of my forms have input hidden _method set to PUT automatically. The only way around this is to set 'type' => 'POST' . But that was not necessary in th...
asked by 20.01.2014 / 17:08
2
answers

Remove input from an array by its value

To remove an entry from an array, we can use the unset () function: / p> <?php $arr = array(1, 2); unset($arr[0]); var_dump($arr); /* Resultado: array(1) { [1]=&gt; int(2) } */ ?> Question How to remove an entry from an...
asked by 28.01.2014 / 00:45
2
answers

What is it, and what is a tick event in PHP?

I was looking at some functions in PHP.net, and I came across a function called declare , and in the example, there is something like this: declare(ticks=1); Below is another example: declare(ticks=1); // A function called on e...
asked by 02.02.2014 / 00:23
1
answer

Code does not run on command line

I have a teste.php file with the following code. <? echo "teste"; ?> When I run the command, the php -f teste.php command will output my code: <? echo "teste"; ?> instead of: teste What's happening?...
asked by 11.11.2014 / 16:16
2
answers

Inheritance or Dependency?

Well, my question is this. I am refactoring a system where I have an integration with a REST API, there is a class called Marketplace (which makes the API queries) which I currently extend from class Curl (which is a simplified int...
asked by 22.11.2014 / 15:53
2
answers

Problems with layout in Zend

I have a view that is formed by a layout different from the default one in my project, so it looks like this: public function init() { //Colocando o layout default $this->_helper->layout->setLayout('layout_paginas'); } But...
asked by 17.12.2013 / 20:16
2
answers

How to load a view into a layout?

I'm trying to load a view into a layout , below my controller below: class IndexController extends BaseController { protected $layout = 'admin.layouts.default'; public function index() { $this->layout->$this->l...
asked by 23.01.2014 / 23:58
1
answer

What is a client-side prepared statement?

I am starting to develop a page using PHP and, as I am still learning the language, I decided to find which module to use to connect to a MySQL database. From this answer , I discovered that the mysql_* module has already been depreca...
asked by 01.02.2014 / 15:12
2
answers

PHP Application Class

In PHP there is some class that works until, for example, I close the tab of my browser, without being a cookie, the session does not serve because it dies when the session ends, I would like to know if there is any class that I can extend in a...
asked by 15.08.2014 / 15:18
2
answers

preg_split is not breaking the strings in the array

I'm not able to use the preg_split() function correctly. I'm trying to break a String in a array() via regex but it's not rolling. $string = "<:termo.9:><:termo.10:><:termo.11:>"; $res = preg_split("/(<:)...
asked by 30.09.2015 / 23:02