At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
LOGICAL OPERATORS: Logical operators are typically used with Boolean (logical) values; when they are, they return a Boolean value. However, the && and || operators actually return the value of one of the specified operands, so if these operators are used with non-Boolean values, they may return a non-Boolean value. TYPES OF LOGICAL OPERATORS: $a and $b And TRUE if both $a and $b are TRUE. $a or $b Or TRUE if either $a or $b is TRUE. $a xor $b Xor TRUE if either $a or $b is TRUE, but not both. ! $a Not TRUE if $a is not TRUE. $a && $b And TRUE if both $a and $b are TRUE. $a || $b Or TRUE if either $a or $b is TRUE.
lets see examples:
WHILE LOOP: while loops are the simplest type of loop in PHP. They behave just like their C counterparts. The basic form of a while statement is: while (expr) statement The meaning of a while statement is simple. It tells PHP to execute the nested statement(s) repeatedly, as long as the while expression evaluates to TRUE. The value of the expression is checked each time at the beginning of the loop, so even if this value changes during the execution of the nested statement(s), execution will not stop until the end of the iteration (each time PHP runs the statements in the loop is one iteration). Sometimes, if the while expression evaluates to FALSE from the very beginning, the nested statement(s) won't even be run once. Like with the if statement, you can group multiple statements within the same while loop by surrounding a group of statements with curly braces, or by using the alternate syntax: while (expr): statement ... endwhile;
Lets see an example: the working of while loop can be seen in the above example.
FOREACH LOOP: The foreach construct provides an easy way to iterate over arrays. foreach works only on arrays and objects, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes: 1.foreach (array_expression as $value) statement 2.foreach (array_expression as $key => $value) statement The first form loops over the array given by array_expression. On each iteration, the value of the current element is assigned to $value and the internal array pointer is advanced by one (so on the next iteration, you'll be looking at the next element). The second form will additionally assign the current element's key to the $key variable on each iteration. Lets see an example:
Example 1: Example 2: NOTE: Reference of a $value and the last array element remain even after the foreach loop. It is recommended to destroy it by unset().
So thats it for this tutorial. Do comment on the tutorial.
for those who join the tutorial now can also see the previous tutorials. 1. http://openstudy.com/study#/updates/4ffa87a8e4b058f8b7666f25 2. http://openstudy.com/study#/updates/4ffb14c9e4b058f8b766d273 3. http://openstudy.com/study?login#/updates/4ffd6086e4b00c7a70c5ed33
good one !
Wooh ! great tutorial annas. ... I think you are the master here of comp. science .. . thanks agan annas
You mean that this is not personal tutorial ?
No, it is not; and it hasn't cited the sources. Therefore, this can be called plagiarism. You have the evidence. "plagiarism (noun) The practice of taking someone else's work or ideas and passing them off as one's own." As defined by Dictionary.com
my dear friend parth pointing finger at someone is quite easy... but practically doing something is different i can create a whole new website using php. between i took help from open source php manuals it not so called plagiarism ... so next time try to be more help than that . thank you for your feed back
These are sentences taken to explain topics... i have a question the professor who taught us these subject they also take help from internet are they doing plagiarism too ??? i think not ... because things whose purpose is explain no matter what they are or where they are taken from comes under the category of helping .
and one more thing i m just a source to bring stuff to help that has been developed many years ago
@annas I'm afraid Parth has a point. Although you wrote your examples on your own, you did take content from MDN and the PHP manual verbatim without citation, and that's plagiarism. I'm going to let Colm decide how he wants to handle this (either by deleting the question, etc, etc) - but you definitely should not do that again without providing links to the sources in YOUR posts.
@Annas - Others *have* been warned about this kind of behavior. The issue here is not that you used the material - as you said, it's open-source so that's fine. The issue is *crediting* the source of this material. Otherwise, it does qualify as plagiarism as it appears you are passing off other people's work as your own. Please remember this in the future, as plagiarism is a very important issue to be aware of - ESPECIALLY now when every source of information is easily available on the internet. Thank you.
wow awesome annas good job