Wednesday, December 2, 2009
Tuesday, November 17, 2009
Oracle/PLSQL: Instr Function
In Oracle/PLSQL, the instr function returns the location of a substring in a string.
The syntax for the instr Oracle function is:
string2 is the substring to search for in string1.
start_position is the position in string1 where the search will start. This argument is optional. If omitted, it defaults to 1. The first position in the string is 1. If the start_position is negative, the function counts back start_position number of characters from the end of string1 and then searches towards the beginning of string1.
nth_appearance is the nth appearance of string2. This is optional. If omitted, it defaults to 1.
The syntax for the instr Oracle function is:
instr( string1, string2 [, start_position [, nth_appearance ] ] )string1 is the string to search.
string2 is the substring to search for in string1.
start_position is the position in string1 where the search will start. This argument is optional. If omitted, it defaults to 1. The first position in the string is 1. If the start_position is negative, the function counts back start_position number of characters from the end of string1 and then searches towards the beginning of string1.
nth_appearance is the nth appearance of string2. This is optional. If omitted, it defaults to 1.
Note:
If string2 is not found in string1, then the instr Oracle function will return 0.Applies To:
- Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For example:
instr('Tech on the net', 'e') | would return 2; the first occurrence of 'e' |
instr('Tech on the net', 'e', 1, 1) | would return 2; the first occurrence of 'e' |
instr('Tech on the net', 'e', 1, 2) | would return 11; the second occurrence of 'e' |
instr('Tech on the net', 'e', 1, 3) | would return 14; the third occurrence of 'e' |
instr('Tech on the net', 'e', -3, 2) | would return 2. |
implink
http://www.aboutoracleapps.com/2008/09/function-to-validate-email-address-in.html
http://www.techonthenet.com/oracle/
http://www.techonthenet.com/oracle/
Wednesday, November 11, 2009
Saturday, October 24, 2009
Thursday, September 17, 2009
basename() Function in PHP
The basename() function returns the filename from a path.
Structure: basename(path,suffix)
path, Required. Specifies the path to check.
suffix, Optional. Specifies a file extension. If the filename has this file extension, the file extension will not show.
PHP PHP Tutorial
Structure: basename(path,suffix)
path, Required. Specifies the path to check.
suffix, Optional. Specifies a file extension. If the filename has this file extension, the file extension will not show.
Example:
$path = "/testweb/home.php";
//Show filename with file extension
echo basename($path) ."
“;
echo basename($path) ."
“;
//Show filename without file extension
echo basename($path,”.php”);
?>
echo basename($path,”.php”);
?>
OUTPUT:
home.php
home
home
PHP PHP Tutorial
Wednesday, September 16, 2009
Tuesday, September 15, 2009
PHP in_array() Function
in_array() is used to search for an array element through the array. It is the standard of PHP4.
The basic construction of in_array ( ) is
in_array(element,array,type);
Here:
element, is the element to be searched.(Required Parameter)
array, is the given array in which we will make our search.(Required Parameter)
type, If this parameter is set, the in_array() function searches for the search-string and specific type in the array (Optional parameter).
Example:
$fruit = array("apple", "mango", "orange");
if (in_array("apple",$fruit))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>
OUTPUT:
Match found
munir hoque in_array php
The basic construction of in_array ( ) is
in_array(element,array,type);
Here:
element, is the element to be searched.(Required Parameter)
array, is the given array in which we will make our search.(Required Parameter)
type, If this parameter is set, the in_array() function searches for the search-string and specific type in the array (Optional parameter).
Example:
$fruit = array("apple", "mango", "orange");
if (in_array("apple",$fruit))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>
OUTPUT:
Match found
munir hoque in_array php
Subscribe to:
Posts (Atom)