<?
$phpfilesystem = fopen("php latest technologies.txt", "r");//read only
if ($phpfilesystem) {
while (!feof($phpfilesystem)) {
$buffer = fgets($phpfilesystem, 4096);
echo $buffer;
}
fclose($phpfilesystem);
}
?>
Saturday, July 26, 2008
PHP Filesystem - fopen
<?
$phpfilesystem = fopen("kuselan movie.txt", "r"); //read only
$phpfiles = fopen("rajini robo.txt", "w"); //write only file pointer at beginning
$phpexamples = fopen("rajini robo.txt", "a"); //write only file pointer at end
?>
$phpfilesystem = fopen("kuselan movie.txt", "r"); //read only
$phpfiles = fopen("rajini robo.txt", "w"); //write only file pointer at beginning
$phpexamples = fopen("rajini robo.txt", "a"); //write only file pointer at end
?>
Thursday, July 17, 2008
PHP - WHILE LOOP
$counter = 1;
while ( $counter <= 10 ) {
echo "Hello world";
$counter = $counter + 1;
}
Tuesday, July 15, 2008
PHP Radio button array example
HTML Code:
1 <input type="radio" name="Seenivasagaperumal" value="1"/>
2 <input type="radio" name="Seenivasagaperumal" value="2"/>
3 <input type="radio" name="Seenivasagaperumal" value="3"/>
4 <input type="radio" name="Seenivasagaperumal" value="4"/>
PHP code:
if(isset($_POST['Submit'])){
$eric = $_POST['Seenivasagaperumal'];
}
1 <input type="radio" name="Seenivasagaperumal" value="1"/>
2 <input type="radio" name="Seenivasagaperumal" value="2"/>
3 <input type="radio" name="Seenivasagaperumal" value="3"/>
4 <input type="radio" name="Seenivasagaperumal" value="4"/>
PHP code:
if(isset($_POST['Submit'])){
$eric = $_POST['Seenivasagaperumal'];
}
Thursday, July 3, 2008
PHP array selected item delete
<?
$tagCollection = array("AJAX", "Analytics", "CSS", "Javascript", "JoshSchumacher.com", "PHP", "Prototype", "Web 2.0");
function strMatch($val)
{
$query = isset($_REQUEST['sel']) ? $_REQUEST['sel'] : '';
return (stripos($val, $query) !== false);
}
$tags = array_filter($tagCollection, "strMatch");
$key = key($tags);
unset($tagCollection[$key]);
print_r($tagCollection);
?>
$tagCollection = array("AJAX", "Analytics", "CSS", "Javascript", "JoshSchumacher.com", "PHP", "Prototype", "Web 2.0");
function strMatch($val)
{
$query = isset($_REQUEST['sel']) ? $_REQUEST['sel'] : '';
return (stripos($val, $query) !== false);
}
$tags = array_filter($tagCollection, "strMatch");
$key = key($tags);
unset($tagCollection[$key]);
print_r($tagCollection);
?>
Subscribe to:
Posts (Atom)