Questions tagged as 'php'

1
answer

Validate composite key with Laravel?

I have a table where the employees of a company with the following fields are inserted; id , name , email , use_id , role_id .    user_id is the id of the company that the official works. The v...
asked by 25.08.2017 / 17:55
2
answers

move_uploaded_file only works once in the file

I'm using the function move_uploaded_file The first time I use it, I send a certain video to a temporary folder. 1 move_uploaded_file($_FILES['cadVideo']['tmp_name'], "temporario/" . 'temp-'.$_FILES['cadVideo']['name']); Wor...
asked by 25.08.2017 / 18:34
1
answer

Is there a difference between using backslash and simple?

I want to know when it comes to uploading a file, like this: $destino = 'imagens/' . $novoNome; Is there a difference between imagens/ and imagens\ ?     
asked by 11.09.2017 / 01:09
2
answers

Get content that is before the number using regex

$MinhaString = "Aventura, Fantasia, Ação 25 de maio a 31 de maio" I tried to do so, but it does not work. $Genero = strstr ($MinhaString,"/[^0-9]/",true); I just need the "Adventure, Fantasy, Action". The date is not static.     
asked by 26.05.2017 / 23:22
2
answers

Select values from a td with click

The code below is a page, which the user types the name of a city, and checks for similar results. With this, it brings multiple results into a dynamically created table, depending on the data brought back from the results, this is already worki...
asked by 06.09.2017 / 14:49
2
answers

Doubt with repeat loop

I'm doing a series of exercises in PHP for practice. And I came across a question regarding loop repetition. To explain it better I'll put the exercise statement here: Efetue um algorítmo PHP que receba dois valores quaisquer e efetue sua mult...
asked by 22.05.2017 / 20:14
1
answer

Rename values using if else

I am using DataTable to generate a table where it has a Status field that receives values 1 or 2 and Status with value 1 is Active and 2 is Inactive. how do I show Active / Inactive instead of # Try to do if else here to print the result but...
asked by 21.07.2017 / 16:11
1
answer

What does version compare?

I was reading about PHP's version_compare() . Still, I did not understand much of the subject, could you explain a little more about?     
asked by 04.08.2017 / 21:39
1
answer

Separate year / month

I have the following date format: 201705 I would like to put a / between the year and the month. How do I do this?     
asked by 08.08.2017 / 23:18
2
answers

PHP Generating PDF

Well, I'm having a problem with a form, basically I'm getting the information from an HTML form with the POST method for a PHP page, I need to generate a pdf from that form and I managed to do it with mPDF (6.0) all right, but I can only save 1...
asked by 01.08.2017 / 14:57