answersLogoWhite

0

PHP Programming

Questions about the PHP programming language; How and when to use it, implementing techniques, debugging and handling errors, and general questions about PHP itself. For questions about software made with PHP, that do not deal with the manipulating, reading, or learning about the actual code, see the Computer Software category.

845 Questions

Why is PHP in Linux?

PHP is a cross platform programming language, it is (in theory) available on any operating system.

What is the difference between dot net and php?

Liprat Consulting offers Basic and Advanced PHP Training course in Noida. Our Faculties have more then 5 to 10 year industrial experience.Our Placements Records is Excellent till now.We also provide Career Consulting & Guidelines for our students. Call us for any query at 9958153868

Does Apache support PHP?

Yes, Apache Tomcat supports the installation and usage of PHP (of any version below 5, not including 5). See the related links for an official Tomcat-PHP installation guide.

How is PHP used in software development?

PHP generally is used to program the back end of websites. The parts that deal with databases and users/passwords, any program that stores information. It is used for most programs on websites today, it is completely server-side, unlike JavaScript or HTML which are interpreted by the web browser on the client-side. The server reads PHP which generally tells it what HTML or JavaScript to display to the browser. When you submit a form it may be handled by PHP as well. So for any sort of interactive website, or a site that needs a database or administration section PHP programming is essential. I may be slightly bias as I am a PHP programmer. One other thing, PHP among many other uses is also used for inter-changeable templates on websites, that is with the click of a button the website's template changes.

What does php mean at the end of an url?

Websites are servers that present pages as they are requested. Pages, in this context, are merely different kinds of files -- much like images and word documents.

The "php" appended at the end of a URL indicates you are requesting a PHP type file, which is composed with the PHP language.

PHP is a programming language that stands for "PHP: Hypertext Preprocessor." It is used to develop websites that present dynamic content and allow page-to-page interaction, such as forums and wikis.

What is an advantage of a web based application?

Their interfaces are self-describing

They can be used to tinegrate legacy systems

They can interoperate across programming language and platform boundaries

They open the e-marketplace to multiple systems

They provide a hightly secure mechanism for accessing third-pary code

How do you encrypt PHP source code?

There are many options to encode and encrypt PHP source code, the most common one being Zend Guard. However it must be noted that using any encryption method will require that the server on which the application is run to have the correct extension to decrypt and decode the PHP source code.

An alternative to encryption is to compile to bytecode. Bytecode is used as intermediate by the compiler, so it has no problem using it, and it provides a little speed boost (one step is already completed). Bytecode is less secure because the code is not encrypted, but simply rendered into a format hard to read for humans but native to computers.

What is the difference beteween ASP and PHP?

There are lots of benefits of using PHP over ASP

Hosting is cheap and as I can think off

1. Because of free OS available that is Linux

2. Web server is free

3. Database is free (MySQL) and gels with it very well

4. As OS is Linux you don't pay any anti virus cost

5. Language is easy to learn and lots of resources available

What is the purpose of function in PHP program?

The function keyword in PHP allows users to define functions beyond those built into the language, like so:
function isFour ($number) { return $number == 4; }

Functions in any language, including PHP, allow the developer to re-use their code.
Without functions all of the code required to do the simplest of tasks must be re-written constantly; but with functions you must only write the code once and then call it whenever needed.

How do you solve error. code 170004 in php?

Do you have an index.php file in the root folder ? This is a common cause of failure. In some case, copy index.html to index.php resolve the problem. If you have index.php, you may need to supply debugging during staging (e.g. set BP_DEBUG option).

How do you start the standard form PHP scripting block?

The standard way to open a block of PHP (escaping it from HTML) is with the tag.

How do you Display The Error Messages in PHP?

To display your own defined error message in php simply echo error message.

To see errro message while query execution simply do mysql_error();

Or so enable syntax error and warnings use error_reporting(1) in the beggining of script.

What are the Error occurs when no checkbox is checked in PHP?

Suppose you have checkbox in HTML from and and you are calling that checkbox by name in php , In that case in you don't check and hit submit , You will get Undefined parameter 'name_of _checkbox' As Error.

How do you mix PHP with a string inside CodeIgniter function?

You must start with double quotes to get expanded variables, then escape nested ones with backslash

<?php echo form_radio($data['filename'], 0, '', "class="uniform" id="$data[ids]"");

Or use single quotes inside double

<?php echo form_radio($data['filename'], 0, '', "class='uniform' id='$data[ids]'");

Notice you don't need to quote single dimensional array indexes inside the square braces if inside double quotes

Where are variables displayed when using the POST method?

When data is POSTed to a PHP script, you may access them from the $_POST super global variable.

What is a basename?

A basename is a file name without any path or directory information.

What is the main method of starting PHP code?

When scripting in PHP, you always want to open up the script with a tag and close it with a ?>tag.

Can a php file be valid without any php code?

PHP files are HTML files with any amount of PHP intermingled into it, so the file can be empty or only contain HTML and be valid, yes.

Can Anyone Elaborate the Full form of PHP Language?

PHP is a general-purpose programming language used to designed a website or and applications. It is the server-side scripting language embedded with HTML to develop Static website, Dynamic website or Web applications. PHP is stand for Hypertext Preprocessor and earlier it was abbreviated as Personal Home Page. For more info visit@ javatpoint

What is difference between key and index in php arrays?

A key is the name of a variable in an array ($array["key"]) and the index is the position it's at ($array = ["key" => 0], the index would be 0).

Keys and indices are the same if the array is not associative though ($array = [true], the key holding the value true is named 0 and is at index 0).

Which superglobal variable holds information about headers paths and script locations?

$_SERVER is a PHP super global variable which holds information about headers, paths, and script locations.

What is PHP platforms?

Platforms for programming languages can mean one of two things: a framework, or a system.

A framework for a programming language (in PHP examples include: Laravel, CakePHP, Symfony) creates a base for programmers to work from. Instead of having to develop a way to easily serve dynamic pages to a user, a developer can use a framework to accomplish this, and get right to creating content.

A system a programming language runs on can also be called a platform (for PHP examples include: Google's App Engine, Heroku, Fortrabbit). The system where you run your PHP simply allows your code to run, though it may include custom PHP installations or extensions.

What is PHP AND ITS FEATURE?

PHP is a general-purpose , Open-source , server-side scripting language .

Used for developing web based applications .

Features of Php:

  • Php has fast transaction speed as compare to other back end languages .
  • Large community
  • open source
  • Web Services
  • Integration with other third party softwares
  • Security Much Dependent upon developer

What is query in php?

query() or mysql_query() are outdated, insecure functions used for communicating queries or "requests" to a database.

What is str split function in PHP?

According to PHP official manual It is used to converts a string to an array.
If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1.
If the split_length length exceeds the length of string, the entire string is returned as the first (and only) array element. Syntax: array str_split ( string string [, int split_length] );
Example :
< ?php
$strW3 = "Hello w3answers";
$arrW3 = str_split($strW3 );
$arrW3 = str_split($strW3 , 3);
print_r($arrW3);
print_r($arrW3);
?>