+ 1
What is resource data type in php?
Give an example of implementation of resource data type in php
1 Respuesta
0
A resource is a special variable, holding a reference to an external resource.
Resource variables typically hold special handlers to opened files and database connections.
Ex:
<?php
// Open a file for reading
$handle = fopen("note.txt", "r");
var_dump($handle);
echo "<br>";
// Connect to MySQL database server with default setting
$link = mysql_connect("localhost", "root", "");
var_dump($link);
?>
Reference# https://www.tutorialrepublic.com/php-tutorial/php-data-types.php