Found 1046 Articles for PHP

realpath_cache_size() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:31:33

59 Views

The realpath_cache_size() function returns realpath cache size i.e. the amount of memory.Syntaxrealpath_cache_size()ParametersNAReturnThe realpath_cache_size() function returns the amount of memory realpath cache is using.Example Live DemoOutput362

realpath_cache_get() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:31:52

68 Views

The realpath_cache_get() function returns realpath cache entries. It returns an array of realpath cache entries.Syntaxrealpath_cache_get()ParametersNAReturnThe realpath_cache_get() function returns an array of realpath cache entries.Example Live DemoOutputArray ( [/home] => Array ( [key] => 4353355791257440477 [is_dir] => 1 [realpath] => /home [expires] => 1538630044 ) [/home/cg/root] => Array ( [key] => 1131813419205508649 [is_dir] => 1 [realpath] => /home/cg/root [expires] => 1538630044 ) [/home/cg/root/8944881/main.php] => Array ( [key] => 584844883037958768 [is_dir] => [realpath] => /home/cg/root/8944881/main.php [expires] => 1538630044 ) [/home/cg] => Array ( [key] => 9037225891674879750 [is_dir] => 1 [realpath] => /home/cg [expires] => 1538630044 ) [/home/cg/root/8944881] => Array ( [key] => 722006552431300374 [is_dir] => 1 [realpath] => /home/cg/root/8944881 [expires] => 1538630044 ) )

parse_ini_string() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:25:58

99 Views

The parse_ini_string() function parses a configuration string. The function returns the settings as an associative array on success. It returns FALSE on failure.Syntaxparse_ini_string(file_path, process_sections)Parametersfile_path − The ini file to be parsed.process_sections − If set to TRUE, you will get a multidimensional array with section names and settings included.ReturnThe parse_ini_string() function returns the settings as an associative array on success. It returns FALSE on failure.Let’s say the content of our “demo.ini” is −[names] one = Anne [urls] host1 = "https://www.example1.com"ExampleOutputArray ( [one] => Anne [host1] => https://www.example1.com )Read More

glob() function in PHP

Samual Sam
Updated on 24-Jun-2020 08:57:19

2K+ Views

The glob() function returns an array of filenames or directories matching a specified pattern. The glob() function returns.An array containing the matched files/directories, Returns an empty array if no file is matched, FALSE on error.Syntaxglob(pattern, flags)Parameterspattern − The pattern to search for.flags − The following are the flags:GLOB_MARK - Adds a slash to each item returnedGLOB_NOSORT - Return files as they appear in the directory (unsorted)GLOB_NOCHECK - Returns the search pattern if no match were foundGLOB_NOESCAPE - Backslashes do not quote metacharactersGLOB_BRACE - Expands {p, q, r} to match 'p', 'q', or 'r'GLOB_ONLYDIR - Return only directories which match the ... Read More

Using HTML5 Server-Sent Events in a web application

Jennifer Nicholas
Updated on 20-Dec-2019 10:49:19

159 Views

To use Server-Sent Events in a web application, you would need to add an element to the document.The src attribute of the element should point to an URL that should provide a persistent HTTP connection that sends a data stream containing the events.The URL would point to a PHP, PERL or any Python script that would take care of sending event data consistently.ExampleHere is an example showing application that would expect server time.                    /* Define event handling logic here */                                                              

PHP timestamp to HTML5 input type=datetime element

karthikeya Boyini
Updated on 20-Dec-2019 10:47:47

681 Views

For HTML5 input time, in PHP:Exampleecho date("Y-m-d\TH:i:s");OutputThe output would be:2018-28-03T19:12:49HTML with Timestamp would be:

How can we write PHP script to get the list of MySQL database?

Priya Pallavi
Updated on 22-Jun-2020 14:31:14

1K+ Views

We can write the following PHP script to get the list of available MySQL databases −Example

How can we write PHP script to count the affected rows by MySQL query?

vanithasree
Updated on 22-Jun-2020 14:30:45

272 Views

PHP uses mysql_affected_rows( ) function to find out how many rows a query changed. To illustrate it we are having the following example −Example           Rows affected by query                  

Which PHP function is used to give the number of rows affected by MySQL query?

Nikitha N
Updated on 22-Jun-2020 14:08:04

161 Views

PHP uses mysql_affected_rows( ) function to find out how many rows a query changed. This function basically returns the number of affected rows in the previous SELECT, INSERT, UPDATE, REPLACE, or DELETE query. Return of an integer > 0 indicates the number of rows affected, 0 indicates that no records were affected and -1 indicates that the query returned an error. Its syntax is as follows −Syntaxmysql_affected_rows( connection );Followings are the parameters used in this function −S. No.Parameter & Description1.ConnectionRequired – Specifies the MySQL connection to use

How can we create a MySQL temporary table by using PHP script?

radhakrishna
Updated on 22-Jun-2020 14:08:57

1K+ Views

As we know that PHP provides us the function named mysql_query() to create a MySQL table. Similarly, we can use mysql_query() function to create MySQL temporary table. To illustrate this, we are using the following example −ExampleIn this example, we are creating a temporary table named ‘SalesSummary’ with the help of PHP script in the following example −           Creating MySQL Temporary Tables              

Advertisements