Skip to content

Tag: php

Delete html elements with php

I was wondering if I had an HTML page, how would I delete an element with php, by the name or id of it. so I could have HTML code like this

Twig tag include vs function include

Twig’s documentation for tag include looks very similar to that of function include. Tag include: Function include: Can somebody point out in what circumstances, one is preferred over the other? Thanks! Answer {{ include() }} Was introduce in Symfony 2.2: Using a function allows you to do whatever you w…

Track how long a user stays on a page?

How can I track how long a user stays on a page before they request another or simply leave the site? Basically, I want to do a check, if a user stays on the page for 20 minutes or longer, then do something. I believe this would require php and javascript, but I am not exactly sure how to accomplish

How to use a 32bit integer on a 64bit installation of PHP?

I run into a problem on my code when moved to production because the production server is 32bit while my development machine is 64bit (I’m running Kubuntu 12.04 64bit). My question is. Is it possible to force an int to be 32bit without installing the 23bit version of PHP? Either that or a library that a…

listing files in folder showing index.php

I have this code, but it is showing the index.php itself How can I filter *.php files? Also is there a way to sort them by modification or creation time? Answer Here’s another that uses ksort or krsort functions (tested). (See comments in code.)