This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blog = array( | |
'title' => 'My Blog', | |
'author' => 'Avinash', | |
'pages' => array('about','services','folio','contact'), | |
); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blog = array( | |
'title' => 'My Blog', | |
'author' => 'Avinash', | |
'pages' => array('about','services','folio','contact'), | |
); | |
// Using the 'foreach' construct to output key => value pairs stored in an array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$blog = array( | |
'title' => 'My Blog', | |
'author' => 'Avinash', | |
'pages' => array('about','services','folio','contact'), | |
); | |
// Outputting values stored in nested arrays |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = "img/15.jpeg"; | |
$data = exif_read_data($file); // Returns a Multidimensional array containing image META information | |
print_r($data); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = "img/15.jpeg"; | |
$data = exif_read_data($file); | |
// Let's create a new array that will store the required image properties and values | |
$img = array(); | |
$img["name"] = $data['FileName']; | |
$img["make"] = $data['Make']; | |
$img["model"] = $data['Model']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!usr/bin/env python | |
secret = 101 | |
guess = input('Guess the correct number: ') | |
print 'You have entered: ', guess | |
if guess < secret : | |
print 'Your guess is lower than the expected number. Try again?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = "img/15.jpeg"; | |
$data = exif_read_data($file); | |
echo "<ul>\n"; | |
foreach ($data as $key => $value) | |
{ | |
// Checks if $value is an array | |
if (is_array($value)) { | |
echo "<li><strong>{$key}</strong>:</li>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My Simple Gallery</title> | |
<link rel="stylesheet" href="css/gallery.css" type="text/css" media="screen" /> | |
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> | |
</head> | |
<body> | |
<div id="wrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function genGallery($path) | |
{ | |
$files = scandir("$path"); | |
$pages = array_chunk($files, 12); | |
$pn = (int) $_GET['page']; | |
foreach ($pages[$pn] as $file) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My Simple Gallery</title> | |
<link rel="stylesheet" href="css/gallery.css" type="text/css" media="screen" /> | |
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> | |
<?php include('gallery.php'); ?> | |
</head> | |
<body> |
OlderNewer