Validating file_exists(“test.txt”); is_file(“test.txt”); is_dir(“/temp”); Checking States is_readable(“test.txt”); is_writable(“test.txt”); is_executable(“test.txt”);
Posts under ‘PHP’
Directory operation in PHP
Create Directory mkdir(“testdir”); Remove Directory rmdir(“testdir”); Open a Directory for Reading $dh = opendir(“testdir”);
File operation in PHP
Open File fopen() returns false when the file can not be openned. if ($fp=fopen(“test.txt”, “w”)){ //do something } Close File fclose($fp);
php books
There are hundreds of PHP books. Which one do you want, if you already have a basic knowledge of PHP? Now you know which is my suggestion.
Upgrade phplist to 2.10.9
phplist has a very important security update. phpBB’s official site is hacked because of this issue for weeks. To upgrade phplist is simple. BACKUP your database! BACKUP your old config.php file, or optionally backup your whole PHPlist so you can rollback if something would go wrong. Replace your old PHPlist with the new version. Copy [...]
strpos()
Using the strpos() function The strpos() function is used to search for a string or character within a string. If a match is found in the string, this function will return the position of the first match. If no match is found, it will return FALSE. Let’s see if we can find the string “world” [...]
strlen()
Using the strlen() function The strlen() function is used to find the length of a string. Let’s find the length of our string “Hello world!”: <?php echo strlen("Hello world!"); ?> The output of the code above will be: 12 The length of a string is often used in loops or other functions, when it is [...]
Strings in PHP
String variables are used for values that contains character strings. In this tutorial we are going to look at some of the most common functions and operators used to manipulate strings in PHP. After we create a string we can manipulate it. A string can be used directly in a function or it can be [...]
PHP Variables
A variable are used for storing a values, like text strings, numbers or arrays. When a variable is set it can be used over and over again in your script All variables in PHP start with a $ sign symbol. The correct way of setting a variable in PHP: $var_name = myvalue; New PHP programmers [...]
Escaping from HTML – php code block
There are about 4 or five type of ways to put the php code into Webpage. I prefer to use following format <?php echo 'if you want to serve XHTML or XML documents, do like this'; ?> via


