<< < 19 20 21 22 23 24 25 26 27 > >>   Sort: Rank

Well-Written Object Oriented Programs
What does a well-written Object Oriented program look like? A well-written object oriented program exhibits recurring structures that promote abstraction, flexibility, modularity and elegance.
2007-03-03, 6826👍, 0💬

What is Java
What is Java? Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that ...
2007-03-03, 5810👍, 0💬

Variables in Double Quoted Strings
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example? In this example, "$a dollars" or "{$a} dollars" will print the same result. But in other cases, you need to use curly braces to protect variable names. For example, for following PHP script will prin...
2007-02-27, 6474👍, 0💬

Octal and Decimal Numbers
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what's the problem? If you assign a variable with a value of 0123, PHP will interpret as an octal number resulting to decimal value of 83. All numbers that preceded with a 0 (zero) will be interpreted...
2007-02-27, 8753👍, 0💬

Executing a PHP Script Using Command Line
How can I execute a PHP script using command line? Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "php myScript.php", assuming "php" is the command to invoke the CLI program. Be aware that if your PHP script was w...
2007-02-27, 6373👍, 0💬

mysql_fetch_object() and mysql_fetch_array() Functions
What is the difference between mysql_fetch_object() and mysql_fetch_array() functions in PHP? mysql_fetch_object() fetches the current row of data from the query result associated with the specified result identifier. The row is returned as an object. See the example code: &lt;?php $result = mys...
2007-02-27, 6940👍, 0💬

urlencode() and urldecode() Functions?
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encoded version: Alphanumeric characters are maintained as is. Space characters are conv...
2007-02-27, 6533👍, 0💬

require(), include() and include_once() Functions
What are the differences between require(), include() and include_once() functions in PHP? All three functions are used to include and evaluate a file into the current script execution. The include_once() statement includes and evaluates the specified file during the execution of the script. This is...
2007-02-27, 5592👍, 0💬

Uploading Files with File Input Fields in a Form
How To Write the FORM Tag Correctly for Uploading Files? When users clicks the submit button, files specified in the &lt;INPUT TYPE=FILE...> will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written &lt;FORM...> tag as: ...
2007-02-27, 5442👍, 0💬

Uploading Files with File Input Fields in a Form
How To Write the FORM Tag Correctly for Uploading Files? When users clicks the submit button, files specified in the &lt;INPUT TYPE=FILE...> will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written &lt;FORM...> tag as: ...
2007-02-27, 5314👍, 0💬

define() - Defining Constants
How do you define a constant in PHP? You can define a constant by using the define() function. Once a constant is defined, it can never be changed or undefined. For example: &lt;?php define("CONSTANT", "Hello world."); echo CONSTANT; // outputs "Hello world." echo Constant; // outputs "Constant"...
2007-02-27, 5597👍, 0💬

Persistent Cookies
What Is a Persistent Cookie? A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You shoul...
2007-02-27, 5829👍, 0💬

Differences between Simple Variables and Variable Variables
What is the difference between $message and $$message in PHP? $message is a simple variable with a fixed name which is called "message". $$message is a variable variable with a variable name which is stored in another variable called $message. If $message contains "user", $$message is the same as $u...
2007-02-27, 5411👍, 0💬

Number of Days between Two Dates
How can we know the number of days between two given dates in PHP? Simple arithmetic: &lt;?php $date1 = date('Y-m-d'); $date2 = '2006-07-01'; $days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24); $days = (int) $days; echo "Number of days since '2006-07-01': $days"; ?&gt;
2007-02-27, 6432👍, 0💬

What Is PEAR
What Is PEAR? 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 n...
2007-02-27, 5479👍, 0💬

What Is a Session
What Is a Session? A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another s...
2007-02-27, 5608👍, 0💬

What is PHP
What is PHP? The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.
2007-02-27, 5725👍, 0💬

Searching Date in Linked Lists
How can I search for data in a linked list? Unfortunately, the only way to search a linked list is with a linear search, because the only way a linked list's members can be accessed is sequentially. Sometimes it is quicker to take the data from a linked list and store it in a different data structur...
2007-02-26, 6626👍, 0💬

Using Macros for Contants
What is the benefit of using #define to declare a constant? Using the #define method of declaring a constant enables you to declare a constant in one place and use it throughout your program. This helps make your programs more maintainable, because you need to maintain only the #define statement and...
2007-02-26, 6697👍, 0💬

Address of the First Element of an Array
When does the compiler not implicitly generate the address of the first element of an array? Whenever an array name appears in an expression such as: array as an operand of the sizeof operator array as an operand of &amp; operator array as a string literal initializer for a character array Then ...
2007-02-26, 7226👍, 0💬

Modulation Operations
Write an equivalent expression for x%8? x&amp;7
2007-02-26, 6761👍, 0💬

Nesting Include Files
Can include files be nested? The answer is yes. Include files can be nested any number of times. As long as you use precautionary measures , you can avoid including the same file twice. In the past, nesting header files was seen as bad programming practice, because it complicates the dependency trac...
2007-02-26, 6584👍, 0💬

"const" and "volatile"
Can a variable be both const and volatile? Yes. The const modifier means that this code cannot change the value of the variable, but that does not mean that the value cannot be changed by means outside this code. For instance, a timer structure can be accessed through a volatile const pointer. The f...
2007-02-26, 6894👍, 0💬

Determining If Symbols Are Defined or Not
How can you check to see whether a symbol is defined? You can use the #ifdef and #ifndef preprocessor directives to check whether a symbol has been defined (#ifdef) or whether it has not been defined (#ifndef). Can you define which header file to include at compile time? Yes. This can be done by usi...
2007-02-26, 6273👍, 0💬

<< < 19 20 21 22 23 24 25 26 27 > >>   Sort: Rank