<?php
ob_start(); // start an output buffer
echo ‘This text is from the w3answers buffer*******<br />’; // output that will be stored in the buffer
$w3buffer = ob_get_contents(); // store buffer content in $w3buffer variable
ob_end_clean(); // stop and clean the output buffer
echo ‘This is not from the w3answers buffer!!!!!!!!<br />’;
echo $w3buffer;
?>
O/p
We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form
....!
A. $_SESSION[‘foo’] = ‘bar’; B. session_start(); C. session_set_save_handler (‘myopen’, ‘myclose’, ‘myread’, ‘mywrite’, ‘mydelete’, ‘mygarbage’); D. $foo = $_SESSION[‘foo’];
Answer A is correct.
Answer B is incorrect because session_start() only activates PHP sessions for the current script. Answer C is incorrect because session_set_save_handler() al....!
www.w3answers.com
->>> List files and directories inside the specified path ->>> By default files order will be ascending ->>> make $f = scandir($direct, 1); it will display the files as descending order
....!
PEAR PHP Extension and Application Repository
PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library.
....!
SELECT COUNT(*) FROM tb_nme;
....!
Ans: MySQL SET function can take zero or more values, but at the maximum it can take 64 values.
....!
The most common category of error arises from mistyped or syntactically incorrect PHP code, which confuses the PHP parsing engine.
1)The missing semicolon *********************** If each PHP instruction is not duly finished off with a semicolon, a parse error will result. In this sample fragment, the first line lacks a semicolon and, therefore, the variable assignment is never completed. What we have here is
<?php $Problem = “a silly misunderstanding”
There are a few things you should be aware of:
1. Since cookies are used to record information about your activities on a particular domain, they can only be read by the domain that created them
2. A single domain cannot set more than twenty cookies, and each cookie is limited to a maximum size of 4 KB
3. A cookie usually possesses six attributes, of which only the first is mandatory. Here they are: * name: the name of the cookie * value: the value of the cookie
<?php$a = “1”;echo $a;?>
A. (int) 1B. (string) “1”C. (bool) TrueD. (float) 1.0E. (float) 1
Answer B is correct.
When a numeric string is assigned to a variable, it remainsa string, and it is not converted until needed because of an operation thatrequires so.
....!
DROP TABLE table_name
Will DELETE the table and DATA
TRUNCATE TABLE table_name
Will DELETE the table DATA not the table definition
....!
Ans: There are two ways: 1) sizeof($myarray) - This function is an alias of count() 2) count($array) - This function returns the number of elements in an array.
Note if you just pass a simple variable instead of an array, count() will return 1.
....!
1. Do not trust user input. 2. Validate user input on the server side. 3. Do not use user input directly in your MySQL queries. 4. Don't put integers in quotes In your MySQL queries. 5. Always escape the output using php built in functions. 6. When uploading files, validate the file mime type using php. 7. If you are using 3rd party code libraries, be sure to keep them up to date. 8. Give your database users just enough permissions. 9. Do not allow hosts other than local....!
Model-view-controller (MVC) is a design pattern used in software engineering. In complex computer applications that present lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns, so that changes to the user interface do not impact the data handling, and that the data can be reorganized without changing the user interface. The model-view-controller design pattern solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate....!
PHP arrays are associative arrays with a little extra machinery thrown in. The associative part means that arrays store element values in association with key values rather than in a strict linear index order. (If you have seen arrays in other programming languages, they are likely to have been vector arrays rather than associative arrays.) If you store an element in an array, in association with a key,all you need to retrieve it later from that array is the key value.....!
PHP arrays are associative arrays with a little extra machinery thrown in.
The associative part means that arrays store element
values in association with key values rather than in a
strict linear index order. (If you have seen arrays in other programming languages, they are likely to have been vector arrays rather
than associative arrays.) If you store an element in an array,
in association with a key,all you need to retrieve it later from
that array is the key value.....!
Recent comments
20 weeks 23 hours ago
13 weeks 1 day ago
23 weeks 1 day ago
23 weeks 4 days ago
28 weeks 15 hours ago
28 weeks 3 days ago
28 weeks 6 days ago
28 weeks 6 days ago
29 weeks 5 days ago
30 weeks 6 days ago