How to Count Number of Lines in a File with PHP
Function to count the number of lines in a file with php or Linux
Function to count the number of lines in a file with php or Linux
If you’re working with various HTML in PHP, then you probably know that strim_tags doesn’t deal with all HTML code correctly. There are some problems with JS elements, with Microsoft Word HTML, etc. In order to get clean text, there is a function that holds all these exceptions. Its name is strip_tags_smart. You’re welcome to check its description… Read More »
This function will help you if you need to monitor folders for recently changed files, or you may implement it as an anti-hacker solution to check your files. Anyway, I think you find it useful. <? //Put here the directory you want to search for. Put / if you want to search your entire domain $dir=’/var/www/html/domain.com/download’; //Put the… Read More »
how to check the string for uppercase characters
Today I will share a simple script that may be used to extract all URLs from a single page. You don’t have to deal with regular expressions anymore, if you don’t like them. DOM technology that is integrated in PHP5 allows you to do this in just some strings of your code without any specific knowledge. Here is… Read More »
base64 encoding is often used to protect PHP code. There is an online tool that allows you to encode and decode the code. Here is the link: Base64 Encoding/Decoding Tool by Thomas Horsten. It really works with the code you have. It’s a common kind of PHP protection and this tool reveals the opinion that base64 encoding is… Read More »
We’re often dealing with file uploads. Sometimes we need to compress the data that is uploaded to the server. Today I will tell you about simple methods that allow to extract the uploaded ZIP file with a PHP script. let’s say we need to install WordPress. In order to save our time (as you know, it is faster… Read More »
If you’re familiar with Directadmin panel, you should know that there is no way to add multiple domain names to an account at once. So, if a customer has 100 domains, he needs to add them one by one. That takes lots of time and is quite a stupid job. I would like to tell you about several… Read More »
Most of PHP programmers need to work with files. Simple file operations are used day by day and often files contain necessary data we need to deal with. Anything that could be stored in a list where values are delimited with new lines is what we often use. Let’s take a simple example. We have a file that… Read More »
As you might know, PHP has some built-in FTP functions. If you need to check a batch of sites for FTP connection, you can do it with a PHP script. This should be necessary if you have some sites on heavy servers to check them for response, or for anything else you might need. Let me show you… Read More »