Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

faq.misc function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php faq.misc () function

Write your php code

 
<?php ?>

Php Result


Your code below



Chapter 77. Miscellaneous Questions

There can be some questions we can't put into other categories. Here you can find them.

1. How can I handle the bz2 compressed manuals on Windows?
2. What does & beside argument mean in function declaration of e.g. asort()?
3. How do I deal with register_globals?

1. How can I handle the bz2 compressed manuals on Windows?

If you don't have an archiver-tool to handle bz2 files download the commandline tool from Redhat (please find further information below).

If you would not like to use a command line tool, you can try free tools like Stuffit Expander, UltimateZip, 7-Zip, or Quick Zip. If you have tools like WinRAR or Power Archiver, you can easily decompress the bz2 files with it. If you use Total Commander (formerly Windows Commander), a bz2 plugin for that program is available freely from the Total Commander site.

The bzip2 commandline tool from Redhat:

Win2k Sp2 users grab the latest version 1.0.2, all other Windows user should grab version 1.00. After downloading rename the executable to bzip2.exe. For convenience put it into a directory in your path, e.g. C:\Windows where C represents your windows installation drive.

Note: lang stands for your language and x for the desired format, e.g.: pdf. To uncompress the php_manual_lang.x.bz2 follow these simple instructions:

  • open a command prompt window

  • cd to the folder where you stored the downloaded php_manual_lang.x.bz2

  • invoke bzip2 -d php_manual_lang.x.bz2, extracting php_manual_lang.x in the same folder

In case you downloaded the php_manual_lang.tar.bz2 with many html-files in it, the procedure is the same. The only difference is that you got a file php_manual_lang.tar. The tar format is known to be treated with most common archivers on Windows like e.g. WinZip.

2. What does & beside argument mean in function declaration of e.g. asort()?

It means that the argument is passed by reference and the function will likely modify it corresponding to the documentation. You can pass only variables this way and you don't need to pass them with & in function call (it's even deprecated).

3. How do I deal with register_globals?

For information about the security implications of register_globals, read the security chapter on Using register_globals.

It's preferred to use superglobals, rather than relying upon register_globals being on.

If you are on a shared host with register_globals turned off and need to use some legacy applications, which require this option to be turned on, or you are on some hosting server, where this feature is turned on, but you would like to eliminate security risks, you might need to emulate the opposite setting with PHP. It is always a good idea to first ask if it would be possible to change the option somehow in PHP's configuration, but if it is not possible, then you can use these compatibility snippets.

Example 77-1. Emulating Register Globals

This will emulate register_globals On.

<?php
// Emulate register_globals on
if (!ini_get('register_globals')) {
    
$superglobals = array($_SERVER, $_ENV,
        
$_FILES, $_COOKIE, $_POST, $_GET);
    if (isset(
$_SESSION)) {
        
array_unshift($superglobals, $_SESSION);
    }
    foreach (
$superglobals as $superglobal) {
        
extract($superglobal, EXTR_SKIP);
    }
}
?>

This will emulate register_globals Off.

<?php
// Emulate register_globals off
if (ini_get('register_globals')) {
    
$superglobals = array($_SERVER, $_ENV,
        
$_FILES, $_COOKIE, $_POST, $_GET);
    if (isset(
$_SESSION)) {
        
array_unshift($superglobals, $_SESSION);
    }
    foreach (
$superglobals as $superglobal) {
        foreach (
$superglobal as $global => $value) {
            unset(
$GLOBALS[$global]);
        }
    }
}
?>

Php faq.misc Function syntax tag

faq.misc php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php faq.misc syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online