Sunday, June 19, 2011
Basic Knowledge about php,mysql
PHP stands for PHP: Hypertext Preprocessor
PHP is a server-side scripting language, like ASP
PHP scripts are executed on the server
PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
PHP is an open source software
PHP is free to download and use
What is MySQL?
MySQL is a database server
MySQL is ideal for both small and large applications
MySQL supports standard SQL
MySQL compiles on a number of platforms
MySQL is free to download and use
PHP + MySQL
PHP combined with MySQL are cross-platform (you can develop in Windows and serve on a Unix platform)
Why PHP?
PHP runs on different platforms (Windows, Linux, Unix, etc.)
PHP is compatible with almost all servers used today (Apache, IIS, etc.)
PHP is FREE to download from the official PHP resource: www.php.net
PHP is easy to learn and runs efficiently on the server side
Where to Start?
To get access to a web server with PHP support, you can:
Install Apache (or IIS) on your own server, install PHP, and MySQL
Or find a web hosting plan with PHP and MySQL support
Tuesday, September 28, 2010
SITE MAP
http://php-mysql-shiko.blogspot.com/
http://php-mysql-shiko.blogspot.com/2009/11/my-first-project-web-based-calendar.html
http://php-mysql-shiko.blogspot.com/2009/07/learn-php-mysql.html
http://php-mysql-shiko.blogspot.com/2010/06/stringmatching-patterns-regular.html
http://php-mysql-shiko.blogspot.com/2009/11/var-skin-skinbordercolor-cccccc.html
http://php-mysql-shiko.blogspot.com/2009_11_01_archive.html
http://php-mysql-shiko.blogspot.com/search?updated-min=2009-01-01T00%3A00%3A00-08%3A00&updated-max=2010-01-01T00%3A00%3A00-08%3A00&max-results=3
http://php-mysql-shiko.blogspot.com/2009_07_01_archive.html
http://php-mysql-shiko.blogspot.com/search?updated-min=2010-01-01T00%3A00%3A00-08%3A00&updated-max=2011-01-01T00%3A00%3A00-08%3A00&max-results=1
http://php-mysql-shiko.blogspot.com/2010_06_01_archive.html
http://php-mysql-shiko.blogspot.com/feeds/posts/default
http://php-mysql-shiko.blogspot.com/search?updated-max=2010-06-26T01%3A15%3A00-07%3A00&max-results=1&reverse-paginate=true
http://php-mysql-shiko.blogspot.com/search?updated-max=2009-11-14T04%3A00%3A00-08%3A00&max-results=1
http://php-mysql-shiko.blogspot.com/search?updated-max=2009-11-25T12%3A28%3A00-08%3A00&max-results=1
http://php-mysql-shiko.blogspot.com/search?updated-max=2009-11-25T12%3A28%3A00-08%3A00&max-results=1&reverse-paginate=true
http://php-mysql-shiko.blogspot.com/search?updated-max=2009-11-14T04%3A00%3A00-08%3A00&max-results=7
http://php-mysql-shiko.blogspot.com/feeds/785005919568808962/comments/default
http://php-mysql-shiko.blogspot.com/feeds/2068277720800017559/comments/default
http://php-mysql-shiko.blogspot.com/feeds/7583099960475159973/comments/default
http://php-mysql-shiko.blogspot.com/feeds/8690610527471527235/comments/default
http://php-mysql-shiko.blogspot.com/search?updated-max=2010-06-26T01%3A15%3A00-07%3A00&max-results=1
http://php-mysql-shiko.blogspot.com/search?updated-max=2010-06-26T01%3A15%3A00-07%3A00&max-results=7
Saturday, June 26, 2010
@@String::::....Matching Patterns (Regular Expressions)
To best demonstrate the usefulness of regular expressions, let's examine a relatively simple problem: searching for a United States ZIP Code. Such numbers are either a five-digit number, or are known as a ZIP+4 and look like "12345-6789." Attempting this search with the standard PHP string functions would require a multiline algorithm. However, with regular expressions, a single function, preg_match(), is all that is required, here's given example :
// A function to detect zipcodes in a string.
function detect_zipcode($string) {
// Use regex to look for zipcodes, return true or false
return preg_match('/\b\d{5}(-\d{4})?\b/', $string);
}
// Try a few examples:
echo '
';';
// A true example:
if (detect_zipcode('Frederick, MD 21701-3883')) {
echo "Test 1: true\n";
}
// Another true example:
if (detect_zipcode('The zipcode 26623 is the area in which I grew up.')) {
echo "Test 2: true\n";
}
// A False example:
if (detect_zipcode('The Phone Number is 301-555-1212')) {
echo "Test 3: true\n";
}
// Another false example:
if (detect_zipcode('42696-313109')) {
echo "Test 4: true\n";
}
echo '
?>
OUTPUT:
As a quick reference, here are some of the most common syntax characters for use in PCRE regular expressions:
Pattern matches:
\d = Digit
\D = Not a digit
\s = Whitespace
\S = Not whitespace
. = Any character (except \n)
^ = Start of string
$ = End of string
\b = Word boundary
Pattern match extenders:
? = Previous item is match 0 or 1 times.
* = Previous item is matched 0 or more times.
+ = Previous item is matched 1 or more times.
{n} = Previous item is matched exactly n times.
{n,} = Previous item is matched at least n times.
{n,m} = Previous item is matched at least n and at most m times.
? (after any of above) = Match as few as possible times.
Option patterns:
Cleaning Up Whitespace...::--
(pattern) = Groups the pattern to act as one item and captures it
(x|y) = Matches either pattern x, or pattern y
[abc] = Matches either the character a, b, or c
[^abc] = Matches any character except a, b, or c
[a-f] = Matches characters a through f
If you want to learn more try to read http://php.net/pcre.
If you want to just remove space from the beginning or end of a string, you can use the built-in function trim() to do that for you. However, often you want to completely clean up the data. You will want to remove leading/trailing spaces, collapse multiple spaces into a single one, and even replace all other types of whitespace with a regular space.
To accomplish this, you can use the regular expression functions of PHP as like as below:
$str = " This line contains\tliberal \r\n use of whitespace.\n\n";
// First remove the leading/trailing whitespace
$str = trim($str);
// Now remove any doubled-up whitespace
$str = preg_replace('/\s(?=\s)/', '', $str);
// Finally, replace any non-space whitespace, with a space
$str = preg_replace('/[\n\r\t]/', ' ', $str);
// Echo out: 'This line contains liberal use of whitespace.'
echo "{$str}";
?>
OUTPUT:
This line contains liberal use of whitespace.
|
|