1. How can we repair a MySQL table?
The syntex for repairing a mysql table is:
- REPAIR TABLE tablename -> This command will repair the table specified.
- REPAIR TABLE tablename QUICK -> If QUICK is given, MySQL will do a repair of only the index tree.
- REPAIR TABLE tablename EXTENDED -> If EXTENDED is given, it will create index row by row.
2. What's diffrence between Get() and Post() Function?
- Get shows information travling on the address bar
- but Post do not shows on the address bar
- the post method is more secure than get method
3. Which is the Best plateform for PHP?
LAMP Linux apache Mysql Php Because In Linux provides basic OS and server Environment In built Mysql no need to download
4. What is meant by urlencode and urldocode?
- urlencode -- URL-encodes string
- urldecode -- Decodes URL-encoded string
5. What is the functionality of the function strstr and stristr?
- strstr -- Find first occurrence of a string
- Example :
$email = 'user@example.com';
$domain = strstr($email, '@');
echo $domain; // prints @example.com
?>
- stristr -- Case-insensitive strstr()
- Example :
$email = 'USER@EXAMPLE.com';
$domain = stristr($email, 'e');
echo $domain;
// outputs ER@EXAMPLE.com
?>
6. What is meant by nl2br()?
- nl2br -- Inserts HTML line breaks before all newlines in a string
- Example :
echo nl2br("foo isn't\n bar");
/*output :
foo isn't
bar
*/
?>
7. How can we submit a form without a submit button?
- we can use the input type as 'image'
- i.e. < input type="image" src="submit.gif">
8. How can we get the properties (size, type, width, height) of an image using PHP
image functions?
- getimagesize -- Get the size of an image
- Returns an array with 4 elements.
- Index 0 contains the width of the image in pixels.
- Index 1 contains the height.
- Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. These values correspond to the IMAGETYPE constants that were added in PHP 4.3.
- Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag.
- Example:
list($width, $height, $type, $attr) = getimagesize("reset.jpg");
echo "
Width : ".$width;
echo "
Height : ".$height;
echo "
Type : ".$type;
echo "
Attribute : ".$attr;
/* Output :
Width : 53
Height : 22
Type : 2
Attribute : width="53" height="22"
*/
?>
9. How I will check that user is logged in or not?
- we can use session for this, at the time of login process we must store the user information into the session, and at the time of
logout we can destroy the session. by this way is the session value is set i.e. not equal to blank then we can easily identify
that user is logged in or not.
- Example:
if (isset($_SESSION['username']) && $_SESSION['username'] != ""){
echo "User already logged in";
} else {
echo "User not logged in";
}
?>
10. How I can get IP address of the usr?
- $_SERVER['REMOTE_ADDR']
11. Explain about the installation of PHP on UNIX systems?
PHP can be installed on UNIX in many different ways there are pre defined packages available which can ease the process. Initially it can be controlled by the command line options. Help can be obtained from./configure help command. After installing PHP modules or executables can be configures and make command should help you in the process.
12. How to enable parsing?
Parsing is an important concept if you want to run your code appropriately and timely. PHP parses all the code present between the opening and closing tags, it ignores everything present out of the closing and opening tags. This tags allow PHP to be embedded between many documents.
13. Explain about null?
Null represents a variable with no value inside. There doesn’t exist any value for type Null. Null is defined to be null if and only if it is assigned a constant null, there is no value set, it is set to be unset(). This is the case insensitive keyword. There are also two functions they are is_null and unset().
14. Explain about PHP looping?
Looping statements are used in PHP to execute the code for a developer defined number of times.
PHP has these following looping statements they are
- while() loop,
- do while() loop,
- for() loop and
- for each() loop .
Foreach is used to loop a block of code in each element in an array.
15. Explain about the advantages of using PHP?
There are many advantages of PHP they are
1) Easy and fast creation of dynamic web pages and a developer can also embed these dynamic functions into HTML.
2) A huge community resource which has a ton of information before you.
3) Connectivity ability lets you to connect to different interfaces and predefined libraries.
4) Execution is very fast because it uses less system resources, etc.
16. How can we destroy the cookie?
- clear all the cookie variables, by using unset() function i.e. unset($_COOKIE).
- destroy the cookie value by it name, if the cookie variable name is 'usename' i.e. $_COOKIE['username'].
17. What is the difference between ereg_replace() and eregi_replace()?
- ereg_replace() -- Replace regular expression
- eregi_replace() -- Replace regular expression case insensitive
Subscribe to:
Post Comments (Atom)
Popular Posts
-
1. How old PHP language is? - PHP began in 1994, so 14 years old. 2. What are different names of PHP? - PHP originally stood for Persona...
-
HTML: a. HTML is a markup language that is used to build static (non interactive and nonanimated) webpages. b. HTML is Case-Insensitive. So...
-
A payment gateway is an e-commerce application service provider service that authorizes payments for e-businesses, online retailers, bricks...
-
Note : This is not a perfect sort order, we have just displaying the list of PHP companies. 1. Photon Infotech No. 2/102, Arvind IT Park (N...
-
- count() -- Count elements in a variable - syntax for count() [int count ( mixed var [, int mode])] - If the optional mode parameter is set...
-
Hai all, Simple show hide sample using Show/Hide? Simple Show/Hide code
-
Sharing PHP, MySQL, Javascript, CSS Knowledge, We can share our PHP knowledge on the basis of PHP versioning, Javascript, AJAX, Stylesheet, ...
-
Use the below code and you can get the exact value in php as us saw in browser. Code: $encode_data = iconv('UTF-8', 'windows-125...
-
Download and Enjoy!
-
A hyperlink is a text or a image that you can click on, and move from one page to another web page. Syntax: < a href= "web pag...
No comments:
Post a Comment