WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Validate an image type using pathinfo() Function
Categories : PHP, Filesystem Click here to Update Your Picture
Robin Varghese
Date : Mar 21st 2009
Grade : 1 of 5 (graded 3 times)
Viewed : 2156
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Robin Varghese
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
//Validate an image type using pathinfo() Function
//$_FILES['sample']['name'] is the name of uploaded file

$info        =    pathinfo($_FILES['sample']['name']);

//pathinfo() function returns an associative array
//$info['extension'] gives value of image type
//For eg.it returns tpe jpg,gif etc

$extension = strtolower($info['extension']);
if(
$extension=="jpg"|| $extension=="jpeg" ||$extension=="pjpeg" || $extension=="bmp" || $extension=="gif" || $extension=="png")
{
       
//Code Here
}
?>
        



Simple way to replace a variable value in a .conf (.ini) file using a webbrowser - the first stage of a complete universal configuration editor
Categories : PHP, Regexps, Code Editors, Filesystem
Display list of files within current and subdirectories (recursively) showing each file as an anchored link and each directory as a category header.
Categories : Filesystem, Directories, Arrays, PHP
Link Submition - Allow your visitors to submit links to the site.
Categories : PHP, Arrays, Filesystem, Beginner Guides
Unix Disk Information with graphs
Categories : PHP, Shell Scripting, Filesystem
Show Source with Line Numbers
Categories : PHP, Regexps, Filesystem
file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
Image Browser
Categories : Filesystem, GD image library, Content Management, PHP
Remote File Saving with PHP - Download and serve a remote file. The content of the file will be updated at fixed intervals.
Categories : PHP, Filesystem, Cache, Sockets, HTTP
Differences between two files
Categories : PHP, Filesystem, Tip
Recursive function to move files on a filesystem. It can be minor changed in order to copy recursively.
Categories : PHP, Filesystem, Algorithms
Functions to read a template file and fill in PHP variables. It will also fill in array variables, displaying parts of the template multiple times.
Categories : PHP, Variables, Filesystem
Random Image Display
Categories : PHP, Filesystem, Graphics, HTML and PHP
Massreplace
Categories : Filesystem, Regexps, Strings, PHP
A simple configuration file editor to ease you life in setting up php applications. Reads variables from a given file automatically and displays current value. New value will be written to file after submit.
Categories : PHP, Filesystem, Regexps, Java Script
Quote For the Day
Categories : PHP, Utilities, Filesystem