Questions tagged as 'php'

2
answers

function Angular.js to calculate age

Good evening guys. In my bd, I store the date of birth of clients. I have a list that presents: name | cpf | age? How could I get the data stored in the bd and using Angular.js or php calculate the current age and fill in my list?...
asked by 18.05.2015 / 23:48
2
answers

How to return the difference in hours between two dates? [duplicate]

I have two dates stored in the variables $date1 and $date2 respectively. They are in the format: YYYY / MM / DD HH: MM Would you like to know how I get the difference in hours between these two dates?     
asked by 15.05.2015 / 22:19
2
answers

Can I use a variable to override a method?

When I rewrite a method, in PHP, can I use a variable to receive the method? I made the example below and it worked normally, but I do not know if this is correct or if it is the best way to rewrite a parent class method. abstract class Ani...
asked by 28.12.2014 / 21:59
3
answers

How to receive a POST without the form tags in PHP?

<?php if(isset($_POST['pagando'])) { //faz alugma coisa } ?> <input type="submit" name="pagando" value="PAGAR"> It gave a general white here personal. How do I send pagando to PHP without input being ins...
asked by 12.08.2015 / 21:41
2
answers

Scan source code and find url from wikipedia

I'm having trouble with regex: / I was using this pattern to get urls from wikipedia from the source code of google search wikipedia\.org[^\" ]+ But urls are encrusted in this way: <a href="/url?q=http://pt.wikipedia.org/wiki/...
asked by 21.12.2014 / 03:28
2
answers

Syntax error when trying to access static method on object stored in property!

In another one of my tests, I noticed that in PHP there is a problem when trying to access the static method of a class, when that class is instantiated in a property of another class; More specifically, I'm having problem with :: - Sco...
asked by 30.07.2015 / 17:58
2
answers

PHP parameter passing

I have a registration screen where the user can change their data and after clicking the 'Save changes' button changes are made to the database. Here is the button I created in the user edit window: <input type="submit" name="atualizarusuar...
asked by 06.08.2015 / 20:58
3
answers

Why is mysqli_ better than mysql_? [duplicate]

I would like to know what are the advantages that mysqli_ has in relation to mysql_ , as it is suggested to me directly to mysqli_ .     
asked by 15.07.2015 / 15:28
4
answers

Next record. PHP + Mysql

I'm a beginner in programming and would like to know how I would make my $ id = 1 , turn 2, 3 and so on. The code at the end means that it needs to compare that value and only then $id++ occurs. I know I need to insert within while...
asked by 12.08.2015 / 00:22
3
answers

Best Practices for Assembling IF Condition

I've been wondering for some time: would there be any difference in performance between declaring an IF in these two ways? Or even if there is no difference in the performance question, is one of these ways more correct than the other? F...
asked by 20.03.2018 / 01:22