Cyber Hyena https://cyberhyena.net web security crypto currencies and learn programming Sun, 28 Nov 2021 17:12:36 +0000 en-US hourly 1 https://wordpress.org/?v=5.8.6 https://cyberhyena.net/wp-content/uploads/2020/11/New-Project-2020-11-24T165858-150x126.png Cyber Hyena https://cyberhyena.net 32 32 Head of the epidemiology center Gao foo talks about the next stages https://cyberhyena.net/blog/2021/11/28/head-of-the-epidemiology-center-gao-foo-talks-about-the-next-stages/ https://cyberhyena.net/blog/2021/11/28/head-of-the-epidemiology-center-gao-foo-talks-about-the-next-stages/#respond Sun, 28 Nov 2021 17:12:36 +0000 https://cyberhyena.net/?p=318 Gao foo the Head of the epidemiology center talks about what will happened in the next few months , foo said that the new covid 19 variant is more dangerous than the old one and says that the people must take vaccines to save them selves foo said also there will be a next lockdown […]

The post Head of the epidemiology center Gao foo talks about the next stages appeared first on Cyber Hyena.

]]>
Read Time:1 Minute, 32 Second

Gao foo the Head of the epidemiology center talks about what will happened in the next few months , foo said that the new covid 19 variant is more dangerous than the old one and says that the people must take vaccines to save them selves

foo said also there will be a next lockdown all over the world after the spread of new covid 19 variant Omicron

foo make advice to help people save there money during the next lockdown and says in the next few months there will be huge risk for starting new projects ,foo advice people to buy gold and currencies , also foo said that people should convert projects to online projects like creating online shops and online apps because this new lockdown all over the world will make a sericeous problems with the global economy and make more people poor

Gao foo was the first person who predict the new covid 19 variant that will make the world go back to 2020 point

The World Health Organization (WHO) has declared a new coronavirus variant to be “of concern” and named it Omicron It had a large number of mutations, and early evidence suggested an increased reinfection risk, the WHO said.

It was first reported to the WHO from South Africa on 24 November, and has also been identified in Botswana, Belgium, Hong Kong A number of countries around the world have now decided to ban or restrict travel to and from southern Africa.

Travellers from South Africa, Namibia, Zimbabwe, Botswana, Lesotho and Eswatini will not be able to enter the UK unless they are UK or Irish nationals, or UK residents US officials said flights from South Africa, Botswana, Zimbabwe, Namibia, Lesotho, Eswatini, Mozambique and Malawi would be blocked, mirroring earlier moves taken by the EU. It will come into effect on Monday.

Happy
Happy
0 %
Sad
Sad
25 %
Excited
Excited
25 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
50 %

The post Head of the epidemiology center Gao foo talks about the next stages appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/11/28/head-of-the-epidemiology-center-gao-foo-talks-about-the-next-stages/feed/ 0
jan pier predections for 2022 to 2030 https://cyberhyena.net/blog/2021/11/21/jan-pier-predections-for-2022-to-2030/ https://cyberhyena.net/blog/2021/11/21/jan-pier-predections-for-2022-to-2030/#respond Sun, 21 Nov 2021 16:17:50 +0000 https://cyberhyena.net/?p=314 jan pier is a famous tech expert specialist in future tech industries and he talked about what will happened from 2022 to 2030 based on Codex Seraphinianus which is a book originally published in 1981 contain an illustrated encyclopedia of an imaginary world, created by Italian artist, architect and industrial designer Luigi Serafini between 1976 […]

The post jan pier predections for 2022 to 2030 appeared first on Cyber Hyena.

]]>
Read Time:1 Minute, 31 Second

jan pier is a famous tech expert specialist in future tech industries and he talked about what will happened from 2022 to 2030 based on Codex Seraphinianus which is a book originally published in 1981 contain an illustrated encyclopedia of an imaginary world, created by Italian artist, architect and industrial designer Luigi Serafini between 1976 to 1978.

what will happen in from 2022 to 2030 ?

smart houses they will work on making the roofs of the buildings based on solar systems , this for making the buildings power it self

smart brain they will plant chips in people brain will be connected to search engines to access information in more fast ways

kasper system : this genetic modification system will make it easy for you to chose how your baby look , like eyes and hair color and more options

memory never dies : this system will allow people to share their memories after they die with certain people , and save this memories for ever

The Codex is an encyclopedia in manuscript with copious hand-drawn, colored-pencil illustrations of bizarre and fantastical flora, fauna, anatomies, fashions, and foods. It has been compared to the still undeciphered Voynich manuscript, the story “Tlön, Uqbar, Orbis Tertius” by Jorge Luis Borges, and the artwork of M. C. Escher and Hieronymus Bosch.

The illustrations are often surreal parodies of things in the real world, such as a bleeding fruit, a plant that grows into roughly the shape of a chair and is subsequently made into one, and a copulating couple who metamorphose into an alligator. Others depict odd, apparently senseless machines, often with delicate appearances and bound by tiny filaments. Some illustrations are recognizable as maps or human faces; while others (especially in the “physics” chapter) are mostly or totally abstract. Nearly all of the illustrations are brightly coloured and highly detailed.

Happy
Happy
40 %
Sad
Sad
20 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
40 %

The post jan pier predections for 2022 to 2030 appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/11/21/jan-pier-predections-for-2022-to-2030/feed/ 0
janthom smith predictions 2022 https://cyberhyena.net/blog/2021/11/10/janthom-smith-predictions-2022/ https://cyberhyena.net/blog/2021/11/10/janthom-smith-predictions-2022/#respond Wed, 10 Nov 2021 17:31:30 +0000 https://cyberhyena.net/?p=308 Janson smith is one of the most famous astrologer in the past 10 years in uk , and recently he published new predictions for 2022 and that’s what will happened , the sun will burn the dark sides of the planet earth as he said an Arabic man in the old civilization will reach out […]

The post janthom smith predictions 2022 appeared first on Cyber Hyena.

]]>
Read Time:36 Second

Janson smith is one of the most famous astrologer in the past 10 years in uk , and recently he published new predictions for 2022

and that’s what will happened , the sun will burn the dark sides of the planet earth as he said

an Arabic man in the old civilization will reach out and be famous in Europe

a big event will happened in European city , and that event will go viral

Jerusalem residents will migrate in groups

scientists will discover new contact from the space maybe from aliens

an earthquake will hit three Arab countries will lead to discover a great treasure also a nuclear storm will hit USA also will be division of three states in America

 

 

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
63 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
38 %

The post janthom smith predictions 2022 appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/11/10/janthom-smith-predictions-2022/feed/ 0
john welden new predictions for 2022 https://cyberhyena.net/blog/2021/10/28/john-welden-new-predictions-for-2022/ https://cyberhyena.net/blog/2021/10/28/john-welden-new-predictions-for-2022/#respond Thu, 28 Oct 2021 17:04:00 +0000 https://cyberhyena.net/?p=301 john welden is famous Canadian astrologer who predicted so many thing that actually happened in the middle east and the world , and about his last predictions for 2022 he said that a massive war will happened in the middle east and the Arab world and after that war 6 states will be united also […]

The post john welden new predictions for 2022 appeared first on Cyber Hyena.

]]>
Read Time:30 Second

john welden is famous Canadian astrologer who predicted so many thing that actually happened in the middle east and the world , and about his last predictions for 2022 he said that a massive war will happened in the middle east and the Arab world and after that war 6 states will be united

also a big earthquake will hit the Arab world and north Africa , in Europe will be a nuclear leak in 2022 and so many people will die , a huge war between Iran and Israel will be in 2022 and it will expand to so many countries

 

 

Happy
Happy
100 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post john welden new predictions for 2022 appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/10/28/john-welden-new-predictions-for-2022/feed/ 0
The New World with New internet alxander motchetsov https://cyberhyena.net/blog/2021/10/17/the-new-world-with-new-internet-alxander-motchetsov/ https://cyberhyena.net/blog/2021/10/17/the-new-world-with-new-internet-alxander-motchetsov/#respond Sun, 17 Oct 2021 15:27:09 +0000 https://cyberhyena.net/?p=297 Alexander Motchetsov the internet specialist who predicted last three month that the internet  will have new protocols update that can lead to failure of access of the internet on some old devices , and after the long down time of facebook services Motchetsocv say that the real reason of that long down time is that […]

The post The New World with New internet alxander motchetsov appeared first on Cyber Hyena.

]]>
Read Time:51 Second

Alexander Motchetsov the internet specialist who predicted last three month that the internet  will have new protocols update that can lead to failure of access of the internet on some old devices , and after the long down time of facebook services Motchetsocv say that the real reason of that long down time is that facebook is applying that new protocols updates

so what next ?

Motchetsov says at the next few months some people with old OS versions like android 4 and 5 and 6 and ios 4 ,5,6 and some windows and mac os will not have access to the new internet , because the new protocols will not support these old devices , these will lead those people to upgrade to new updated devices or they will not have internet access

the satellite internet will be the new world internet and more new protocols will be applied , the main target is to make internet available to every one and every time that leads to more affective spy solutions

 

 

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
100 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post The New World with New internet alxander motchetsov appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/10/17/the-new-world-with-new-internet-alxander-motchetsov/feed/ 0
robert klaven predictions 2022 https://cyberhyena.net/blog/2021/10/11/robert-klaven-predictions-2022/ https://cyberhyena.net/blog/2021/10/11/robert-klaven-predictions-2022/#respond Mon, 11 Oct 2021 14:39:52 +0000 https://cyberhyena.net/?p=294 robert klaven is a specialist in predictions and we had the opportunity to publish his predictions for the year 2022 1- the people in middle east will had a bad morning news , one of the middle east leaders will be killed 2- in the start days of 2022 the world will have great news […]

The post robert klaven predictions 2022 appeared first on Cyber Hyena.

]]>
Read Time:37 Second

robert klaven is a specialist in predictions and we had the opportunity to publish his predictions for the year 2022

1- the people in middle east will had a bad morning news , one of the middle east leaders will be killed

2- in the start days of 2022 the world will have great news , new technologies will help us to beat co v  id 19 for ever

3- a big earthquake will be in USA and another one in Europe

4- the diabetes will end for ever in 2022 the world will discover a cure ,

5- Arabic doctors will find a cure also for cancer

6- the Chinese dragon will wake up and in the sky of china we will see 5 stars

 

Happy
Happy
50 %
Sad
Sad
0 %
Excited
Excited
50 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post robert klaven predictions 2022 appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/10/11/robert-klaven-predictions-2022/feed/ 0
ethical hacker course online free more than 15 hours https://cyberhyena.net/blog/2021/04/15/ethical-hacker-course-online-free-more-than-15-hours/ https://cyberhyena.net/blog/2021/04/15/ethical-hacker-course-online-free-more-than-15-hours/#respond Thu, 15 Apr 2021 19:46:13 +0000 https://cyberhyena.net/?p=283 today we will talk about ethical hacker course online and free this course is full course in one video on YouTube by the cyber mentor Learn network penetration testing / ethical hacking in this full tutorial course for beginners.   This course teaches everything you need to know to get started with ethical hacking and […]

The post ethical hacker course online free more than 15 hours appeared first on Cyber Hyena.

]]>
Read Time:1 Minute, 34 Second

today we will talk about ethical hacker course online and free this course is full course in one video on YouTube by the cyber mentor Learn network penetration testing / ethical hacking in this full tutorial course for beginners.

 

This course teaches everything you need to know to get started with ethical hacking and penetration testing. You will learn the practical skills necessary to work in the field. Throughout the course, we will develop our own Active Directory lab in Windows, make it vulnerable, hack it, and patch it. We’ll cover the red and blue sides. We’ll also cover some of the boring stuff like report writing :). This course was originally live streamed weekly on Twitch and built from lessons learned in the previous week.

 Course created by The Cyber Mentor. Check out his YouTube channel: here

the best in this ethical hacker course is free and simple and easy to learn the cyber mentor give you the information in easy way also you will learn allot of things in this 15 hours course

you can also see our php free course 

Certified Ethical Hacker (CEH) is a qualification obtained by demonstrating knowledge of assessing the security of computer systems by looking for weaknesses and vulnerabilities in target systems, using the same knowledge and tools as a malicious hacker, but in a lawful and legitimate manner to assess the security posture of a target system. This knowledge is assessed by answering multiple choice questions regarding various ethical hacking techniques and tools. The code for the CEH exam is 312-50. This certification has now been made a baseline with a progression to the CEH (Practical), launched in March 2018, a test of penetration testing skills in a lab environment where the candidate must demonstrate the ability to apply techniques and use penetration testing tools to compromise various simulated systems within a virtual environment.

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
100 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post ethical hacker course online free more than 15 hours appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/04/15/ethical-hacker-course-online-free-more-than-15-hours/feed/ 0
How to Change a Column Size or Type in MySQL https://cyberhyena.net/blog/2021/03/19/how-to-change-a-column-size-or-type-in-mysql/ https://cyberhyena.net/blog/2021/03/19/how-to-change-a-column-size-or-type-in-mysql/#respond Fri, 19 Mar 2021 20:05:17 +0000 https://cyberhyena.net/?p=277 Just beorigin you made a MySQL column single type or size doesn’t mean that it hsimilar to stay that lifestyle. Changing the column type or size in an befounding information bsimilare is simple.​ Changing a Databsimilare Column Size as well as Type You alter a column size or type in MySQL using the ALTER TABLE […]

The post How to Change a Column Size or Type in MySQL appeared first on Cyber Hyena.

]]>
Read Time:1 Minute, 48 Second

Just beorigin you made a MySQL column single type or size doesn’t mean that it hsimilar to stay that lifestyle. Changing the column type or size in an befounding information bsimilare is simple.​

Changing a Databsimilare Column Size as well as Type

You alter a column size or type in MySQL using the ALTER TABLE as well as MODIFY commas well ass face to face to produce the alter.

Let’s claim, for example, that you establish a column identificationd “State” on a tcan identificationd “Address” as well as you earlier set it up to hold two characters, anticipate ing people to application 2-character state abbreviations. You search that various people entered entire identifications instead of 2-character abbreviations, as well as you expectation to everyoneow them to do this. You rely on to produce this column enormousr to everyoneow the full state identifications to fit. Here is how you do it:

 

ALTER TABLE dealwith MODIFY state VARCHAR(20) ;

In generic expressions, you application the ALTER TABLE commas well as stalked depend on the tcan identification, then the MODIFY commas well as stalked depend on the column identification as well as novel type as well as size. Here is an example:

 ALTER TABLE tcanidentification MODIFY columnidentification VARCHAR(20) ;

The maximum width of the column is decide d depend on the number in parentheses. The type is identified depend on VARCHAR similar being a varican character industry.

About VARCHAR .. MySQL

The VARCHAR(20) in the examples can alter to whatever number is appropriate for your column. VARCHAR is a character string of varican length. The maximum length—in this example it is 20—reveals the maximum number of characters you expectation to store in the column. VARCHAR(25) could store up to 25 characters.

Other Uses for ALTER TABLE

The ALTER TABLE commas well as can also be applicationd to add a novel column to a tcan or to remove an entire column as well as everyone its information from a tcan. For example to add a column, application:

 ALTER TABLE tcan_identification
 ADD column_identification informationtype

To delete a column, application:

 ALTER TABLE tcan_identification
 DROP COLUMN column_identification

read more about mysql
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post How to Change a Column Size or Type in MySQL appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/03/19/how-to-change-a-column-size-or-type-in-mysql/feed/ 0
What Is Overloading in Java? https://cyberhyena.net/blog/2021/03/19/what-is-overloading-in-java/ https://cyberhyena.net/blog/2021/03/19/what-is-overloading-in-java/#respond Fri, 19 Mar 2021 19:56:55 +0000 https://cyberhyena.net/?p=274 more than loading in Java is the capability to tell the difference increasingly than single approach with the same identification in a category. The compiler is can to recognize the difference between the approach’s beorigin of their approach sig qualities of somethings. This expression also goes depend on approach more thanloading, as well as is primely […]

The post What Is Overloading in Java? appeared first on Cyber Hyena.

]]>
Read Time:1 Minute, 58 Second

more than loading in Java is the capability to tell the difference increasingly than single approach with the same identification in a category. The compiler is can to recognize the difference between the approach’s beorigin of their approach sig qualities of somethings.

This expression also goes depend on approach more thanloading, as well as is primely applicationd to just goup the read capability of the program; to produce it look better. However, do it too much as well as the reverse effect may come into play be origin the code looks too resemble , as well as can be inappropriate to read.

Examples of Java more than loading ,, Overloading in Java

There are nine contrast with lifestyles the print approach of the System.out object can be applicationd:

 print.(Object obj)\n print.(String s)\n print.(boolean b)\n print.(char c)\n print.(char[] s)\n print.(double d)\n print.(afloat  f)\n print.(int i)\n print.(long l)\n

When you application the print approach in your code, the compiler will decide which approach you expectation to ceveryone depend on looking at the approach sigqualitiesofsomething. For example:

 int number = 9;\n System.out.print(number);\n String text = "nine";\n System.out.print(text);\n boolean nein = false;\n System.out.print(nein);\n

A contrast with print approach is being rename each time beorigin the parameter type being psimilarsed is contrastwith. It’s applicationful beorigin the print approach will rely on to vary how it operations depending on whether it hsimilar to deal with a string, integer, or boolean.

More Inpattern ion on morethan loading ,,Overloading in Java

Something to restaff coordinator about more than loading is that you can’t establish increasingly than single approach with the same identification, number, as well as type of claim beorigin that declaration doesn’t let the compiler perceive how they’re contras twith.

Also, you can’t declare two approach’s similar having identical sigqualities of somethings, even if they establish extraordinary return types. This is beorigin the compiler doesn’t consider return types questions contrastwithiating between approachs.

more than loading in Java bethecauses consistency in the code, which helps eliminate inconsistencies, which could link to syntax mistakes. more than loading is also just a athingorwayofdoingsomethingthatiseasyandquick;atimeorarrangementthatisconvenient lifestyle to produce the code esimilarier to read via.

read more about JAVA

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post What Is Overloading in Java? appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/03/19/what-is-overloading-in-java/feed/ 0
free PHP programming course E5 learn to code https://cyberhyena.net/blog/2021/03/16/free-php-programming-course-e5-learn-to-code/ https://cyberhyena.net/blog/2021/03/16/free-php-programming-course-e5-learn-to-code/#respond Tue, 16 Mar 2021 18:38:44 +0000 https://cyberhyena.net/?p=268 FREE php course Lecture #5: Selection Structure  Any PHP script is built out of a series of statements. A statement can be an assignment, a function call, a loop (discussed in a later lecture), a conditional statement, or even a statement that does nothing (an empty statement). Statements usually end with a semicolon. In addition, […]

The post free PHP programming course E5 learn to code appeared first on Cyber Hyena.

]]>
Read Time:14 Minute, 55 Second

FREE php course Lecture #5: Selection Structure  Any PHP script is built out of a series of statements. A statement can be an assignment, a function call,
a loop (discussed in a later lecture), a conditional statement, or even a statement that does nothing (an
empty statement). Statements usually end with a semicolon. In addition, statements can be grouped
into a statement-group by encapsulating a group of statements with curly braces. A statement-group is
a statement by itself as well.

Control Statements … FREE php course

A control statement is a statement that is used to alter the continuous sequential invocation of
statements. It is a statement that controls when and how one or more other statements are executed. In
PHP, statements fall into three general types:

Assignment, where values, usually the results of calculations, are stored in variables (as discussed
in previous lecture).
Input / Output, data is read in or printed out.
Control, the program makes a decision about what to do next.

Unless being specified, statements in a PHP program are executed one after another in the order in
which they are written, this is known as sequential execution. However, programs can be much more
useful if the programmer can control the sequence in which statements are run. You will soon find out
that there will always be a need to jump off the linear sequence. A transfer of control occurs when the
next statement to be executed are specified by the programmer, instead of the immediate succeeding
statement.

As a programmer, the control of statement sequence is actually the arrangement of:

• selecting between optional sections of a program.
• repeating important sections of the program.

All PHP programs are thus written in terms of three forms of control: sequence, selection, and
repetition.

Conditional Statements

A conditional statement is used to decide whether to do something at a special point or to decide
between two courses of action. A conditional statement chooses among alternative actions in a PHP
program. The if statement performs (selects) an action based on a tested condition.

A condition is an expression with a Boolean value (TRUE or FALSE) that is used for decision making. For example,

$x >= 3

In this statement, the value of variable $x can be anything, such as 1, 2, 8, 110, 224, and so on. This
expression is then sometimes true, sometime false depending on the current value of $x .

Conditional statements can be as simple as the above one or they can be compound statements as
shown below:

($x >= 3) AND ($x <= 15)

For example:

<?php
$s = 6;
$t = 5;
if ($s>4 AND $t>4) {echo “TRUE!”; }
?>

The output is TRUE! because both conditions $s>4 and $t>4 are true.

 

The if statement …..,, FREE php course

The if statement is one of the most important features of many languages, PHP included. It allows for
conditional execution of code fragments. PHP’s if statement is similar to that of the C programming
language.

In PHP, many conditional statements (also known as selection statements) begin with the keyword if,
followed by a condition in parentheses.

The statement(s) of execution are grouped together between curly brackets { }. Such a grouping is called a compound statement or simply a block. The syntax
then looks like:

if ( condition )
{ execution }

where condition is an expression that is evaluated to its Boolean value. If expression evaluates to
TRUE, PHP will execute the statement, and if it evaluates to FALSE, PHP ignores it.
The following test decides whether a student has passed an exam with a passing mark of 60. Notice
that it is possible to use the if part without the else part.

<?php
$grade=rand(50,99); // generate a random number from 50 to 99
if ($grade >= 60) // test if the value of user entry >= 60
{ echo “Pass!”; } // display Pass!
?>

The following example checks whether the current value of the variable $hour is less than 12 and the
echo statement displays its message only if this is the case (namely $hour < 12 is true).

<?php
$hour = date(“H”); //get the current hour value
if ($hour < 12) {
echo “Good morning!”;
}
?>

The if … else statement

The above example has a logic problem. It specifies what to execute when the $grade is greater than or
equal to 60, but it did not specify what to do if the $grade is less than 60. To solve this logic problem,
use the if … else statement. The if statement performs an indicated action (or sequence of actions) only
when the condition is tested to be true; otherwise the execution is skipped. The if … else statement
performs an action if a condition is true and performs a different action if the condition is false.
The else statement extends an if statement to execute a statement in case the expression in the if
statement evaluates to FALSE. The syntax looks like:

if ( condition )
{ execution 1 } // do this when condition is TRUE
else
{ execution 2 } // do this when condition is FALSE

You can now rewrite the above example to:

<?php
$grade=rand(50,99); // generate a random number from 50 to 99
if ($grade >= 60) // condition
{ echo “Pass!”; } // execution 1
else
{ echo “Fail!”; } // execution 2
?>

 

The else statement is only executed if the “if” expression is evaluated to FALSE as well as any elseif
expressions that evaluated to FALSE.

Often you need to have more than one statement to be executed conditionally. Of course, there is no
need to wrap each statement with an if clause. Instead, you can group several statements into a
statement group.

If statements can be nested infinitely within other if statements, which provides you with complete
flexibility for conditional execution of the various parts of your program.

The elseif statement ….. FREE php course

Sometimes a programmer needs to make a decision based on several conditions. This can be done by
using the elseif variant of the if statement.

The elseif statement, as its name suggests, is a combination of if and else. Like else, it extends an if statement to execute a different statement in case the original if
expression evaluates to FALSE. However, unlike else, it will execute that alternative expression only if
the elseif conditional expression evaluates to TRUE.

As soon as one of these conditions yields a true result, the following statement or block is executed and
no further comparisons are performed.

There may be several elseif’s within the same if statement. The first elseif expression (if any) that
evaluates to TRUE would be executed. In PHP, you can also write else if (in two words) and the
behavior would be identical to the one of elseif (in a single word). The syntactic meaning is slightly
different, but the bottom line is that both would result in exactly the same behavior.
The elseif statement is only executed if the preceding if expression and any preceding elseif
expressions evaluated to FALSE, and the current elseif expression evaluated to TRUE.

In the following example we are awarding grades depending on the exam result.

<?php
$grade=rand(50,99); // generate a random number from 50 to 99
if ($grade >= 90)
{ echo “A”; }
elseif ($grade >= 80)
{ echo “B”; }
elseif ($grade >= 70)
{ echo “C”; }
elseif ($grade >= 60)
{ echo “D”; }
else
{ echo “F”; }
?>

In this example, all comparisons test a single variable called result. In other cases, each test may
involve a different variable or some combination of tests. The same pattern can be used with more or
fewer elseif’s, and the final lone “else” may be left out. It is up to the programmer to devise the correct
structure for each programming problem.

The if…then statement can also be used to handle HTML form in one single PHP script (a later lecture
will discuss this topic in details). For example:

<?php
if ($_POST) { // if the form is filled out
$x = $_POST[“vofx”];
if ($x>=5) { echo “x is greater than or equal to 5!”; }

else { echo “x is less than 5!”; }
}
else { // otherwise display the form
?>
<form action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>” method=”post”>
Enter a value for <i>x</i>:
<input type=”text” name=”vofx” size=5>
<input type=”submit” value=”Check”></form></p>
<?php
}
?>

The $_POST expression is evaluated when the script is loaded to determine whether or not the form
fields (a textbox) has been filled in. If so, the script ignores the else part and processes the user input. If
not, the script displays only a form for the user to fill in.

if ($_POST) { // if the form is filled out
…… }
else { // otherwise display the form
?>
<form action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>” method=”post”>
……
</form>
<?php
}
?>

Notice that it uses the $_SERVER[‘PHP_SELF’] system variable to send the user inputs to itself.

Alternative syntax ….. FREE php course

PHP offers an alternative syntax for some of its control structures. the basic form of the alternate
syntax is to change the opening brace to a colon (:) and the closing brace to endif. For example:

<?php if ($a == 5): ?>
A is equal to 5
<?php endif; ?>

In the above example, the HTML block “A is equal to 5″ is nested within an if statement written in the
alternative syntax. The HTML block would be displayed only if $a is equal to 5.

The alternative syntax applies to else and elseif as well. The following is an if structure with elseif and
else in the alternative format.

<?php
if($a > $b):
echo $a.” is greater than “.$b;
elseif($a == $b): // Note the combination of the words.
echo $a.” equals “.$b;
else:
echo $a.” is neither greater than or equal to “.$b;
endif;

?>

Note that elseif and else … if will only be considered exactly the same when using curly brackets as in
the above example. When using a colon to define your if/elseif conditions, you must not separate else if
into two words or PHP will fail with a parse error.

Problem of complexity

When writing a PHP program, you may have to compare the same variable (or expression) with many
different values, and execute a different piece of code depending on which value it equals to. You can
do so with nested if … else statements, but it will increase the complexity of your program. Consider
the following example:

<?php
$x= date(“w”); //number of the day of the week; 0 for Sunday
if ($x == 0) { echo “Sunday”; }
elseif ($x == 1) { echo “Monday”; }
elseif ($x == 2) { echo “Tuesday”; }
elseif ($x == 3) { echo “Wednesday”; }
elseif ($x == 4) { echo “Thursday”; }
elseif ($x == 5) { echo “Friday”; }
elseif ($x == 6) { echo “Saturday”; }
else { echo “No such option!”; }
?>

This above code will display different value according to the number of the weekday—0 for Sunday, 1
for Monday, and so on. If the number is not in {0, 1, 2, 3, 4, 5, 6}, then it will display “No such
option!”. This example use only one block of code to handle 8 conditions, which certainly increase the
complexity (imaging you have 20 conditions!). This is exactly what the switch statement is for.

The switch..case Statement

The switch statement is similar to a series of if statements on the same expression, but it is a better way
of writing a program when a series of if..else’s occurs. It is important to understand how the switch
statement is executed in order to avoid mistakes. The switch statement executes line by line (actually,
statement by statement). The switch/case statement syntax is as follows:

switch (expression) {
case value1:
statement(s);
break;
case value2:
statement(s);
break;
………..
………..
default:
statement(s);
break;
}

where the case expression may be any expression that evaluates to a simple type, that is, integer or
floating-point numbers and strings. Arrays or objects cannot be used here unless they are not
referenced to a simple type.

In a switch statement, the condition is evaluated only once and the result is compared to each case
statement. In an elseif statement, the condition is evaluated again. If your condition is more
complicated than a simple compare and/or is in a tight loop, a switch may be faster. The advantage of
using switch statement is to simplify the complexity of if…else’s.

The following two examples show two different ways to test for the same conditions – one uses a series
of if and elseif statements, and the other uses the switch statement.

It is important to understand how the switch statement is executed in order to avoid mistakes. The
switch statement executes line by line (actually, statement by statement). In the beginning, no code is
executed. Only when a case statement is found with a value that matches the value of the switch
expression does PHP begin to execute the statements. PHP continues to execute the statements until
the end of the switch block or the first time it sees a break statement. The break construct is used to
force the switch code to stop. PHP will continue to execute the statements until the end of the switch
block or the first time it sees a break statement. If you don’t include a break statement at the end of a
case’s statement list, PHP will go on executing the statements of the following case.

Consider the following examples;

FREE php course
FREE php course

Only when a case statement is found with a value that matches the value of the switch expression does
PHP begin to execute the switch statements.

Notice that a special case is the default case. This case matches anything that doesn’t match any other
cases, and should be the last case statement.

In PHP, the statement list for a case can also be empty, which simply passes control into the statement
list for the next case. The use of default case is also optional. In the following example, only when the
weekday is Tuesday will a user see an output.

 

<?php
$i= date(“w”);
switch ($i) {
case 0:
case 1:
case 2:
echo “It is Tuesday, and you just won the prize!”;
break;
case 3:
case 4:
case 5:
case 6:
}
?>

In PHP, the switch structure allows usage of strings. For example,

<?php
switch ($i) {
case “apple“:
echo “i is apple”;
break;
case “bar“:
echo “i is bar”;
break;
case “cake“:
echo “i is cake”;
break;
}
?>

The alternative syntax for control structures is supported with switches. For example:

<?php
switch ($i):
case 0:
echo “i equals 0”;
break;
case 1:
echo “i equals 1”;
break;
case 2:
echo “i equals 2”;
break;
default:
echo “i is not equal to 0, 1 or 2”;
endswitch;
?>

It is possible to use a semicolon ( ; )instead of a colon ( : )after a case. For example:
<?php
switch($beer)
{
case ‘Tuborg’;
case ‘Carlsberg’;
case ‘Heineken’;
echo ‘Good choice’;
break;
default;
echo ‘Please make a new selection…’;
break;

}
?>

 

Review Questions

1. The result of the following calculation is __.

<?php echo (9 != 7); ?>

A. 1
B. 0
C. True
D. False

2. The result of the following calculation is __.

<?php echo !(6 <= 4); ?>

A. 1
B. 0
C. True
D. False

3. Given the following code segment, what is the output?

<?php
$x = 3;
if ($x > 3) { echo “Correct!”; }
else { echo “Incorrect!”; }
?>

A. Correct!
B. Incorrect!
C. True
D. False

4. Given the following code segment, what is the output?

<?php
$x = 6;
if (($x > 3) AND ($x <=7)) { echo “Correct!”; }
else { echo “Incorrect!”; }

?>

A. Correct!
B. Incorrect!
C. True
D. False

5. The result of the following calculation is __.

<?php
$i=6;
if ($i>=4) {
if ($i=5) { echo $i; }
else { echo $i–;} }
else { echo $i++; }
?>

A. 4
B. 5

C. 6
D. 3

6. The result of the following calculation is __.

<?php
$i=3;
if ($i>=4) {
if ($i=5) { echo $i; }
else { echo $i–; } }
else { echo ++$i; }
?>

A. 4
B. 5
C. 6
D. 3

7. If the value of $i is 0, what is output?

<?php
switch ($i) {
case 0:
echo “i equals 0”;
break;
case 1:
echo “i equals 1”;
break;
case 2:
echo “i equals 2”;
break;
default:
echo “i equals 3”;
break;
}
?>

A. i equals 0
B. i equals 1
C. i equals 2
D. i equals 3

8. If the value of $i is 3, what is output?

<?php

switch ($i) {
case 0:
echo “i equals 0”;
break;
case 1:
echo “i equals 1”;
break;
case 2:
echo “i equals 2”;
break;
default:
echo “i equals 3”;
break;
}
?>

A. i equals 0
B. i equals 1
C. i equals 2
D. i equals 3

9. If the value of $i is 7, what is output?

<?php
switch ($i) {
case 0:
echo “i equals 0”;
break;
case 1:
echo “i equals 1”;
break;
case 2:
echo “i equals 2”;
break;
default:
echo “i equals 3”;
break;
}
?>

A. i equals 0
B. i equals 1
C. i equals 2
D. i equals 3

10. If the value of $i is 0, what is output?

<?php
switch ($i) {
case 0: echo “i equals 0”;
case 1: echo “i equals 1”;
case 2: echo “i equals 2”;
default: echo “i equals 3”;
}
?>

A. i equals 0
B. i equals 0i equals 1
C. i equals 0i equals 1i equals 2
D. i equals 0i equals 1i equals 2i equals 3

full lectures HERE

FREE php course

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

The post free PHP programming course E5 learn to code appeared first on Cyber Hyena.

]]>
https://cyberhyena.net/blog/2021/03/16/free-php-programming-course-e5-learn-to-code/feed/ 0