Thursday, 28 January 2016

CURL

Introduction:

CURL stands for Client Url's ,using curl we can connect with different servers having multiple type of protocols like http,https,POST,PUT and many more.
We can use CURL to download files from different serves also we can create api mechanism using curl by usi authentication process, we will discuss complete example of curl api's on next post. 

Monday, 23 November 2015

phpFile Managment

php File Managment:

 Alright i am back after a long time so ... my new topic from today file management , no doubt its play an important role for any programming language its also important for php as well.
so i am starting from basic for file management operations.

we need to open a file,read a file ,do some modifications in files, i will discuss today how to read files in php.

Example:


<?php

// read files from my destination
$file = 'destination/phpguidefile.txt' or die('file not Found');
// to open file we use fopen
$fh = fopen($file, 'r') or die('file unable to open');
// to read file data/text use fread
$content = fread($fh, filesize($file)) or die('Reading Error');
// also its important to close file use fclose
fclose($fh);
// Echo text/data from file in php script
echo $content;

?>