1
<script>
jQuery(function($){
$('#timer').countdown({
until: new Date("2015-11-04 12:00:00"),
compact: true
});
});
</script>
I need to transform the above code in a function and then apply this function to a PHP variable that is inside a loop. How to do this?
while ( $linha = mysql_fetch_array($query) ) {
echo $datafinal; // Y-m-d h:i:s
}
http://answall.com/questions/90095/posso-fazer-o-javascript-escreverphp you cannot send js variables to php
– Amadeu Antunes
And there’s another solution @Amadeuantunes?
– Marcos Vinicius
you can send the date from php to js so the date would be a php variable and could use it below, you can use AJAX but I don’t think it would be necessary
– Amadeu Antunes
Is that what you want? http://answall.com/questions/58958/passar-vari%C3%A1vel-php-para-javascript
– Wallace Maxters
I need within a retrieved date loop in the database to implement a Countdown. How could I do this personal? http://axitech.com.br/ccl/
– Marcos Vinicius
You can send your function output to PHP.
– Ivan Ferrer
I found it interesting but I didn’t understand it very well. Can you explain it to me @Ivanferrer? I think this can solve.
– Marcos Vinicius
@Marcosvinicius, I put the solution in response.
– Ivan Ferrer
And what is your question regarding the answer?
– Ivan Ferrer