Questions tagged as 'php'

1
answer

Efficiency of PHP Query Execution PHP

Is there any performance difference in the codes below? $result = $pdo->query($sql); foreach($result as $reg){ ... } and ... foreach($pdo->query($sql) as $reg){ ... } I did some testing, but the behavior of the runs does not seem...
asked by 29.01.2016 / 18:40
1
answer

Install PagSeguro / PHP in Laravel

No composer.php I'm putting it like this: "require": { "laravel/framework": "4.2.*", "pagseguro/php": "dev-master", #"pagseguro/php": "2.5.0", "cagartner/correios-consulta": "0.1.*", "intervention/image": "2.*" }, But...
asked by 12.05.2015 / 22:20
1
answer

Send message to specific user in Websocket PHP

I have a real-time chat application with Websocket. But at the moment it sends messages to all users, I would like to know how do I send them to a specific user. In case, when I click on the user (from a list that appears next to it), he will st...
asked by 02.05.2015 / 05:59
2
answers

Consuming Moodle Web Service

I'm trying to consume the moodle webservice, following a js / rest example that I found in github, I created a test.php with the code below (changing the domainname and token), but when I call the page I do not receive anything in the variable r...
asked by 14.05.2015 / 18:45
2
answers

Base64 file extension

I'm doing a REST service and need to get an image by base64, but the image can come with any extension, such as jpg , png , gif , etc. How to identify this extension and proceed with the recording? The code looks like this:...
asked by 19.10.2016 / 14:12
2
answers

Change the quality of online video?

How do sites like YouTube and Facebook offer different qualities for upcoming videos? Is there any specific tool / code to change the quality of videos, or do they encode and save video files in different formats? 360p, 480p, 720p, 1020p ... How...
asked by 13.10.2016 / 15:44
2
answers

Sort by day of the week, starting with today

I want to sort the results by the days of the week I have 7 events, 1 event for each day, and you have to sort it as follows:   Sunday, Monday, Tuesday, Wednesday , Thursday, Friday, Saturday Assuming that today is Wednesday it will ha...
asked by 15.02.2015 / 02:28
1
answer

Insert "Watermark" on video at upload

I'm currently uploading videos with basic php. I do not use very complex code, I'm only in the basics! And this basics is pretty much as follows: $mp4 = $_FILES['mp4']; $mpname = $mp4['mpname']; $mptmp = $mp4['tmp_name']; $mpsize = $mp4['s...
asked by 21.02.2015 / 01:50
2
answers

Handling data output from the database in PHP

In many cases we have data in the database that is not in the format that we want them to be displayed. As an example, let's say I have a table called users and in this table a field called role that will store a user's access level. Let'...
asked by 20.02.2015 / 17:40
2
answers

array of simple arrays for json_encode

I need to create a json document, with the following structure: [ { "Name": "Lacy", "Email": "[email protected]" }, { "Name": "Chancellor", "Email": "[email protected]" }] Currently, I have the following arra...
asked by 20.02.2015 / 22:42