Skip to content

Tag: php

php strtotime in seconds and minutes

i use ths method to find the difference between two timestamp and get the number of seconds between those two times, and i refresh the information with jquery like a counter. When the difference is more than 60 seconds, the $time comes back to 0, like a reset. i would like to display 1 min XX s for example An…

Symfony Console tab completion

I have an application with a Symfony Console based CLI. The application does not use the Symfony framework, just the Symfony Console component. When I execute I get the usual overview with the name, version, options and registered commands shown. Suppose I just have one command, called “displaykittens&#…

How to Remove Hidden Characters in PHP

I have following piece of code, which reads text files from a director. I have used a list of stopwords and after removing stopwords from the files when the words of these files along with their positions then there come extra blank characters in place of where stopword exist in the document. For example, a f…

PHP Laravel – Allow users to use a custom domain name

I’ve looked through pretty much every single page I could find on the topic, but I’m still bit confused. I have a PHP Laravel 4.0 web site, which is at http://www.mywebsite.com When a user signs up, each user gets their own page http://user1.mywebsite.com I have set the above via wildcard sub doma…

PHP Port Scanning

This may be a duplicate post, BUT I’ve not seen any answer that correctly resolves this. I’m trying to find a php script that can correctly determine the state of a TCP or UDP port. I’ve tried several of the ones I’ve found online and they all return the wrong results. EG: On my local …