Questions tagged as 'php'

3
answers

How to format Date field in Ionic Form / Angularjs

I have a date field on a form that looks like this: <label class="item item-input item-floating-label"> <span class="input-label">Validade da Oferta</span> <input type="date" ng-model="product.cadas...
asked by 12.01.2017 / 11:40
1
answer

php can not copy remote file, but it downloads via browser

Hello. This file: link I can download through the browser, but I can not copy directly to my server using PHP. I have tested all possible ways (copy (), file_gets_content (), fopen (), curl (), etc) and there is no way to make it work. H...
asked by 10.11.2016 / 16:33
1
answer

How to get all the parameters in a GET request with Silex?

I'm having my first contacts with the Silex framework. I have the following script to be able to capture a GET parameter: $app->get('/', function (Request $request, Silex\Application $app) { return sprintf('Meu nome é %s', $r...
asked by 10.11.2016 / 18:17
2
answers

Write to txt file with PHP

I have a file txt but it is missing the nome in several lines of the file, I would like to name it according to the order number. The logic would be to check the order number of the line that is unnamed in the case of the 203...
asked by 04.11.2016 / 15:00
2
answers

When using the Laravel helper view what kind of data is being returned?

I'm hesitant to comment on the method below: public function index() { $posts = Post::orderBy('created_at', 'desc')->paginate(10); return view('painel.post.listar', compact('posts')); } It would be correct to comment this way:...
asked by 10.11.2016 / 02:40
2
answers

Change date language captured in RSS

I'm getting RSS content from a website with the following code: <?php $rss = new DOMDocument(); $rss->load('https://jovemnerd.com.br/nerdnews/feed/'); $feed = array(); foreach ($rss->getElementsByTagName('item') as $node) { $item...
asked by 10.11.2016 / 17:53
2
answers

How to assign values to an associative array in php?

In an array, for example: $arr = array('item1', 'item2' ... 'itemN'); I want to assign a value to each item. For this, I tried a foreach: foreach($arr as $a => $b) $b = 4; but is informed by the IDE (phpStorm) that the unused lo...
asked by 21.09.2016 / 16:44
1
answer

Picking items from the JSON array

I'm working with api from youtube and a query returns the json below. How do I get and print each item separately? For example I want to print each "videoId". How do I do? { "kind": "youtube#activityListResponse", "etag": "\"I_8xdZu766_FSaex...
asked by 25.09.2016 / 00:32
1
answer

Default due date - PHP

I researched this question here on the portal and, although it contains similar questions, I did not find anything in the sense I need. I also did not find anything that would help my problem exactly. Based on the date of the first installmen...
asked by 19.09.2016 / 02:04
1
answer

List errors returned in an ajax request

I have a Controller that is returning errors like this: return response()->json(['erros' => $this->renderHttpException($e)]); I'm getting this json as a response to the ajax request: {"email":["The email field is required."],"tel...
asked by 23.09.2016 / 20:30