Malhar Lathkar has Published 155 Articles

PHP HTTP context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 09:19:04

348 Views

IntroductionGiven below is the list of context options for http:// and https:// transportsmethodHTTP method supported by the remote server. Defaults to GET.headerAdditional headers to be sent during request.user_agentValue to send with User-Agent: header. By default the user_agent php.ini setting is used.contentAdditional data to be sent after the headers. Typically used with ... Read More

PHP FTP context options

Malhar Lathkar

Malhar Lathkar

Updated on 21-Sep-2020 09:13:52

299 Views

IntroductionContext options for http:// and https:// transports are listed below −overwriteAllow overwriting of already existing files on remote server while uploading only.resume_posFile offset at which to begin transfer. Applies for downloading only.Defaults to 0 (Beginning of File).proxyProxy FTP request via http proxy server. Applies to file read operations only. Ex −tcp://squid.example.com:8000.This ... Read More

PHP variable Variables

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 15:10:40

1K+ Views

IntroductionIn PHP, it is possible to set variable name dynamically. Such a variable uses value of an existing variable as name. A variable variable is defined with two $ signs as prefixExample Live DemoOutputThis script produces following outputxyz abcd abcd abcdNote that value of $$var1 is same as $xyz, xyz being ... Read More

PHP Variables from External Sources

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 15:05:20

222 Views

IntroductionPHP's variable namespace is populated by external sources such as HTML form elements, cookies and screen coordinates of image submit buttonHTML form elementsWhen a web page submits data in its HTML form to a PHP script, it is automatically made available to the script in the form of $_POST, $_GET ... Read More

PHP Variable Basics

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 15:03:34

329 Views

IntroductionName of a variable in PHP starts with a $ sign. It is followed by either a letter (A-Z either upper or lowe case) or underscore, and then there may be any number of letters, digits or underscores. Name of variable in PHP is case sensitive.Syntax//valid variables $var=10; $VAR="Hello"; //different ... Read More

PHP Constants

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 15:00:15

257 Views

IntroductionConstants are represented literally in an assignment expression such as $x=10 or $name="XYZ" where 10 and XYZ are numeric and string constants assigned to variables. In PHP, it is possible to define a constant with a user defined identifier with the help of define() functionSyntaxdefine ( string $name , mixed ... Read More

PHP String Data Type

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:58:10

2K+ Views

Definition and UsageIn PHP, a string data type is a non-numeric sequence of charaters.Any character in the ASCII set can be a part of a string. PHP doesn't support UNICODE.In PHP, literal representation of string can be done with single quotes, double quotes, with heredoc syntax and nowdoc syntax.Syntax//Literal assignment ... Read More

PHP Resources

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:53:19

7K+ Views

Definition and UsageIn PHP, Resource  is a special data type that refers to any external resource. A resource variable acts as a reference to external source of data such as stream, file, database etc. PHP uses relevent functions to create these resources. For example, fopen() function opens a disk file ... Read More

PHP NULL

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:48:05

6K+ Views

Definition and UsageIn PHP, a variable with no value is said to be of null data type. Such a variable has a value defined as NULL. A variable can be explicitly assigned NULL or its value been set to null by using unset() function.Syntax$var=NULL;It is possible to cast variable of ... Read More

PHP Iterables

Malhar Lathkar

Malhar Lathkar

Updated on 19-Sep-2020 14:41:10

684 Views

Definition and UsageFrom version 7.1 onwards, PHP provides a new pseudo-type called iterable. Any object (such as array) that implements Traversable interface is acceepted by it. This type uses foreach construct or a generator function that yields one value at a a time.SyntaxA function can have iterable as type of ... Read More

Previous 1 ... 3 4 5 6 7 ... 16 Next
Advertisements