Questions tagged as 'php'

1
answer

Practical application of isset () and unset () in PHP

I would like a practical application of the isset() and unset() functions. I'm studying PHP but I do not quite understand how this can be applied in the development of some application. Thanks in advance.     
asked by 28.02.2017 / 01:39
1
answer

Else does not work in PHP

I'm trying to use the code below, but else does not work. Returns the error Parse error: syntax error, unexpected 'else' (T_ELSE) <?php if ($status == 'True') ?> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> &...
asked by 19.02.2017 / 01:12
1
answer

Create variables with an array dynamically

Dynamically declare variables for($i = 0; $i < 10 ; $i++) { $arry[$i]= "var" .$i; echo $arry[$i] . "<br>"; $$arry[$i] = "ok"; //<-Aqui queria que a variavel $var'i' = "ok" } echo $var0     
asked by 06.03.2017 / 21:33
2
answers

Square root and cubed number on a table

I'm learning PHP and I have a job where I have to do the square root and the cube of the numbers from 1 to 10, displaying in a table with PHP. I have already managed the square root of the numbers from 1 to 10 all in a square and the same with t...
asked by 21.02.2017 / 16:25
2
answers

Print day of the week in full adding one day

I'm trying to print the day of the week in full (Monday, Tuesday ...) of a date returned from the database. However, it is always printing with one day less, for example, instead of Monday printing, it is printing Sunday, I wanted to know what I...
asked by 20.02.2017 / 12:56
2
answers

Resizing image when inserting with php

I want to insert the image into the site by type="file" it resizes to 400x300, I tried everything but I can not. Image verification code to send to BD and insert into website: require_once("conn.php"); $imgm=$_FILES['imageM']; $imgf=$_FILES...
asked by 08.11.2016 / 18:38
1
answer

How to get variable value inside a function in a Class for another function?

I have a class for Image Upload, and I want to get the value of a variable within a function called salvar() ! I want to create a function called getNome() to get the name of the image with extension. But the variable with...
asked by 16.11.2016 / 04:52
2
answers

how to parse a json return with complex object

How do I parse a json return where I have optional fields such as phone, the user can have more than one such as residential, mobile and phone to message, in this case if the user has informed the phone it list if I have not informed it does n...
asked by 14.11.2016 / 18:30
2
answers

Validation of MVC forms - PHP

To validate forms with MVC concepts, would it have to be in Controller , Model , or View ? Searching the internet I saw some articles on the subject, but some recommend doing in model others in view , the final, in> view ? This method do...
asked by 18.02.2016 / 02:37
2
answers

Get URL ID instead of INDEX

Hello, I would like to know how to get the URL ID as if the index was the ID, so type Using GET: http://domain.com/api.php?id=1999&output=json $id = $_GET['id']; Okay, so long, well I'd like to know how you can get the id like this: h...
asked by 07.02.2016 / 22:04