Sie sind auf Seite 1von 3

1.

The fgetss() function returns a line, with HTML and PHP tags removed, from an
open file.It stops returning on a new line, at the specified length, or at EOF,
whichever comes first.This function returns FALSE on failure.
Sample code:

<?php
$file = fopen("test.htm","r");
echo fgetss($file,1024,"<p>,<b>");
fclose($file);
?>

Output:

This is a paragraph.

Source:

<p><b>This is a paragraph.</b></p>

The fgetcsv() function parses a line from an open file, checking for CSV fields.It
stops returning on a new line, at the specified length, or at EOF, whichever comes
first.t returns the CSV fields in an array on success, or FALSE on failure and EOF.

Sample code:

<?php
$file = fopen("contacts.csv","r");
print_r(fgetcsv($file));
fclose($file);
?><?php
$file = fopen("contacts.csv","r");
print_r(fgetcsv($file));
fclose($file);
?>
CSV File:

Kai Jim, Refsnes, Stavanger, Norway


Hege, Refsnes, Stavanger, Norway

Output:

Array
(
[0] => Kai Jim
[1] => Refsnes
[2] => Stavanger
[3] => Norway
)

2.

File locking restricts other users from changing a specific file. This allows only one
user or process access to this file at any given time. This is to prevent the problem
of interceding updates on the same files.

If process A and process B open the same file, process A then changes the
file and saves it. Process B, which still has the original state file, makes some
changes then saves it, rendering the changes made by process A lost.

3.

The GRANT is a command used to provide access or privileges on the database


objects to the users.

Syntax:

GRANT privilege_name
ON object_name
TO {user_name |PUBLIC |role_name}
[WITH GRANT OPTION];
The REVOKE command removes user access rights or privileges to the database
objects.

Syntax:

REVOKE privilege_name
ON object_name
FROM {user_name |PUBLIC |role_name}

4.

ANY - compares a value to each value in a list or results from a query and evaluates
to true if the result of an inner query contains at least one row. ANY must be
preceded by comparison operators. Suppose using greater than ( >) with ANY
means greater than at least one value.

IN - checks a value within a set of values separated by commas and retrieve the
rows from the table which are matching. The IN returns 1 when the search value
present within the range otherwise returns 0.

SOME - compare a value to each value in a list or results from a query and evaluate
to true if the result of an inner query contains at least one row. SOME must match
at least one row in the subquery and must be preceded by comparison operators.
Suppose using greater than ( >) with SOME means greater than at least one value.

ALL - is used to select all records of a SELECT STATEMENT. It compares a value to


every value in a list or results from a query. The ALL must be preceded by the
comparison operators and evaluates to TRUE if the query returns no rows.

EXISTS - checks the existence of a result of a Subquery. The EXISTS subquery tests
whether a subquery fetches at least one row. When no data is returned then this
operator returns 'FALSE'. A valid EXISTS subquery must contain an outer reference
and it must be a correlated Subquery.
The select list in the EXISTS subquery is not actually used in evaluating the EXISTS
so it can contain any valid select list.

Das könnte Ihnen auch gefallen