 |
I was wondering in how many ways can we iterate through an array in PHP. So, I figured out a few, here's it...
Our Array, which we will be iterating on,
$arr = array('PHP','Perl', 'JavaScript','AJAX', 'Python','ASP', 'C#');
1. Using a simple for loop
// using for loop
...
By pradeep
Last Message By pradeep
|
1 22,442 |
 |
EXIF stands for Exchangeable image file format is standard by which metadata is stored in image & sound file formats, these are sometimes added by digital camera / software / or manually added by a user. These standards metadata tags help people track / store info, for example Flickr shows the...
By pradeep
Last Message By Alex.Gabriel
|
1 1,256 |
 |
Manier times we require to create logs of various activities/errors in our web applications, so here we'll look into how to achieve that.
Logging data to a file in PHP can be as simple or as complex as you want to make it. Break it down, though, and it all comes down to these three simple lines...
By pradeep
|
0 9,191 |
 |
PHP offers one alternative - a special Log class that comes courtesy of PEAR, the PHP Extension and Application Repository (http://pear.php.net). In case you didn't know, PEAR is an online repository of free PHP software, including classes and modules for everything from data archiving to XML...
By pradeep
|
0 7,929 |
 |
Title says it all but to reemphasize that below PHP code block validate an email address. Its always good to have a client side validation for faster user responses but backend check is also needed for user not having client side scripting on.
<?php
function emailsyntax_is_valid($email) {
...
By pradeep
|
0 2,854 |
 |
Many times we require to format a number to output with thousand place comma separator, here is a function will help you do so.
function numcomma ($value)
{
if(strpos($value,"."))
{
$decimalval = substr($value,strpos($value,".")+1);
$value =...
By pradeep
|
0 2,004 |
 |
This time I took a bit of a change from the usual subjects I write, not a big change though. The reason for writing this set of articles (More to come and there's another beginners one as well) is because I felt that there isn't a proper or complete guide written for the pure beginners to start...
By ManzZup
|
0 2,581 |
 |
Most applications like browsers, text editors, etc. come built in with spelling suggestions, they highlight a possible incorrect English word (any language for that matter) and offers a list of suggestions when clicked or selected. Even, search engines provide spelling suggestions.
Even you...
By pradeep
|
0 2,034 |
 |
How To Find Similar Sounding Words
Let say a condition where we wanted a utility that finds a matches of words which sounds all same. For example, stupid/stpid/stuuupid/sstuuupiid would all have the same soundex code, S313, Soundex is a phonetic algorithm which computes a soundex value for each...
By pradeep
|
0 2,582 |
 |
PHP being the most popular & easy to deploy language for web applications offers a large number for functions for sorting compared to other languages like Perl, Python, etc which hardly have a few basic functions which have to be extended by the programmer.
PHP reduces coding time by providing...
By pradeep
|
0 1,448 |
 |
Allows you to include dynamically a single file, a list of files or a whole directory. No more tedious include statements.
Background
This is designed to be similar to Java's package system but instead uses a directory, file/s or */ALL, and include type(INC, IN_O, REQ, REQ_O). The reason is...
By pein87
|
0 1,475 |
 |
Smarty is a templating engine for PHP, it's one of the most popular templating engine used by PHP developers. Using a templating engine helps businesses separate presentation logic & application logic.
Templating, you can say is a way to separate the business logic from the presentation...
By pradeep
|
0 1,678 |
 |
PHPExcel project provides a set of classes, which allow us to Read, Write and Create Excel documents in PHP.
File formats, supported by PHPExcel are .xls, .xlsx, CSV, .ods, Gnumeric, PDF and HTML.
Requirements for PHPExcel:
PHP version >= 5.2.0
PHP extensions php_zip,php_xml,php_gd2...
By jasbir712
|
0 2,414 |
 |
Memcached is a high-performance open-source caching solution, generally used to improve web application performance by avoiding round-trips to RDBMS, to know more about memcached read Faster Webapps With Memcached.
In this article we'll discuss about installing and using memcached in PHP. A PHP...
By pradeep
|
0 1,725 |
 |
Amazon Simple Storage Service (S3) is a low-cost & high-availability storage service provided by Amazon Web Services. It's very efficient and cheap, it allows you to store as much as you want and there is no limit, you pay for what you use and you pay as you go, there is no commitment. You can...
By asha
|
0 1,733 |
 |
Most of us have know PHP as a language used for web development, but it is also being used for writing backend processing scripts, backup scripts, deferred processing scripts etc. for a long time but still not as much as other scripting languages as Perl, Python, or Ruby. But if you are a PHP...
By asha
|
0 1,413 |
 |
File Transfer Protocol or popularly known as FTP has been a de facto standard for transferring files for many years, can be used in many programs / utilities like backup programs, etc. PHP is being increasingly used in writing scripts for maintenance and other purposes and the FTP extensions...
By pradeep
|
0 1,277 |
 |
This class is a wrapper for array's that allows you to use oop to create and manage an array
Background
This class is inspired by Java and C#'s array class.
The Code
If you'd like to use oop to manage an array this class is meant to provide a data type of sorts for that effort.
By pein87
|
0 899 |
 |
Creates a class that acts as a string wrapper similar to Java and C#.
Background
Php doesn't do types so I created a class to act as a wrapper to provide a faux type for strings
The Code
The code is designed so that you can create text variables which have there own methods that you...
By pein87
|
0 920 |
 |
Parsing HTML has always been a tough cookie even for seasoned programmers, but nowadays parsing HTML is extensively used for scraping websites, crawling, error detection websites, and many other useful purposes. In this article we'll be looking into parsing HTML using PHP, for this purpose I...
By pradeep
|
0 988 |