0

PHP: Download Web Page using file_get_contents

Posted by Joys of Programming on in PHP, Web

You can use curl to download a webpage in PHP. It is also possible to download a web page using file_get_contents(). In the above example, we try to download the web page of Mozilla. Let’s try to download a non existing web page We find the following error

Tags: ,

 
0

PHP: Associative Arrays

Posted by Joys of Programming on in PHP

Arrays in PHP are different from other programming languages like C/C++? Java that they allow heterogenous elements and support negative index. Associative arrays are like the hashmaps or the key value pairs. In case of associate arrays, the indices can be strings. They are called associative arrays because you associate a string to another value [...]

Tags: , , ,

 
0

PHP Arrays: Initialization with Set of Elements

Posted by Joys of Programming on in PHP

It is possible to insert elements into the array one by one. But in some cases, we know the elements of an array before hand. In such cases, we can make use of the function array(). The elements to be inserted can be specified as parameters to the array. You will notice that the elements [...]

Tags: , ,

 
0

PHP Arrays: Negative Index

Posted by Joys of Programming on in PHP

We see that arrays in PHP can have heterogenous elements and the elements can be inserted at any position of choice. But what we have seen is the possibility of using positive numbers as index (position). But it is also possible to use negative numbers as index. Let’s take a look at the example We [...]

Tags: , ,

 
1

Boolean Variables in PHP

Posted by Joys of Programming on in PHP

As discussed in Variables in PHP, there is no need to specify the type of a variable in PHP. So, if you want to use the boolean variable in PHP, just specify the value A boolean variable can take the following values true, false, TRUE, FALSE. And the name suggests their meanings, Let’s use them [...]

Tags: ,

 
0

Variables in PHP: Declaration and Printing

Posted by Joys of Programming on in PHP

The variables in PHP are simply declared as Take for example Now you notice that we did not explicitly specify the type of the variable like many programming languages (C, C++, Java). In PHP, you don’t have to declare types. Let’s see a floating point number. Now let’s see how we can print the variables [...]

Tags: , , ,

 
0

PHP in Eclipse Error: The session could not be started.

Posted by Joys of Programming on in Eclipse, PHP

If you are trying to run PHP in Eclipse, you may encounter the following error The session could not be started. In order to generate debug information, please make sure that the debugger is properly configured as a php.ini directive. This is because you need to install a debugger in your system. There are two options available. Xdebug [...]

Tags: , , ,

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.