Questions tagged as 'php'

2
answers

Organizing Response Array

How to organize array index of 2nd dimension? Search $stmt = getConn()->query("SELECT hash,id,quantidade FROM pergaminhos"); $resp = $stmt->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_COLUMN); response Array ( [1] => Array...
asked by 22.06.2018 / 08:34
1
answer

Default MVC and DAO

I have a layered system. I'm using MVC and inside the MODEL folder I have a DAO folder. Let's say I have a file named Professor_DAY and another called Aluno_DAO. Question: Can I include the student file in Teacher to call any method presen...
asked by 30.06.2018 / 00:05
2
answers

How to write data from a form into a database by converting the fields to JSON?

I have some form, example: <form action="confi.php" method="post" enctype="multipart/form-data"> <p><input type="text" name="nome" value="nome"> <p><input type="text" name="email" value="email"> <p>...
asked by 15.03.2017 / 16:19
1
answer

How to empty php buffer during execution?

I want something to print on the screen at runtime, not just when the script is finished, I tried: <?php ob_start(); for($i = 0; $i < 5; $i++){ echo $i . '<br>'; ob_flush(); flush(); sleep(3); } but did not work,...
asked by 01.03.2017 / 19:39
2
answers

Change tag value of an XML

I'm having a hard time. I am not able to scan the XML file and change the values of the tags that I need, they are NOTA and SERIE . I have to replace these tags with new values, does anyone know how to do this? I researched, but the...
asked by 08.03.2017 / 19:40
2
answers

How to turn this text into an array with name and description?

I have a .txt file. It has the name of the images and the description about them. So I wanted to do it like this: nome:descrição imagem1.jpg:"descrição exemplo 1"; I know how to read the php file. Now I wanted to separate the information, b...
asked by 12.03.2017 / 01:41
2
answers

Replace list () by putting value in each index of an array

So I was browsing through php.net when I came across List () and went to see what it was for. Then they gave me the following example: $info = array('Café', 'marrom', 'cafeína'); list($bebida, $cor, $substancia) = $info; echo "$bebida é $cor e...
asked by 14.03.2017 / 14:16
2
answers

API Central Bank, IPCA and SELIC

I was asked for a project, to make monthly consultation of IPCA and SELIC rate, from a central bank API. I wanted to know where I could find this API, because I found nowhere, nor the site itself.     
asked by 09.03.2017 / 14:36
2
answers

Extension 'Inc' and MVC in PHP

I know that it is not mandatory to use the inc and class codenames in the name of the files, but for the sake of organization it is even recommended. The doubt is due to the fact that the class codename is easy to underst...
asked by 09.03.2017 / 02:28
2
answers

Timezone does not work PHP

When I give the command: echo ini.get('date.timezone') . "<br>"; nothing appears, I already configured it in php.ini and nothing, I also already put the default in the code and nothing too. Can anyone help me?     
asked by 18.01.2017 / 22:53