Basically, thisiswhat's goingtodecidewhether a loopshouldcontinueorwhatshouldhappeninand, ifelsestatementsocomparisonoperatorsarebasicallyjust a verysimpleconcept.
Thisisverysimple.
PartofMatthewprobablylearnedwhenyouwereabouteight, andallyou'redoingisyou'reaskingisthevalueof a variableequaltoe a value?
Peoplebuy a booknowagain, ifyouliketheInternet, youdon't likebooks.
Meisanoldtimer.
I like a bookbecause, asyoucanseehere, whenyoustartlookingatcomparisonoperatorsandalsosomethingcalledlogicaloperatorswhenyournewit's veryeasytojustbeabletoopenupto a pageandhaveeverythinglistedhere.
Soissimplybeingabletohavefeetsheetslikethiswhenyou'reriding, andiffor a looporsomethinglikethatandjustmakingsureyou'rewritingthings, howthey'resupposedtobewritten, thatcanmakeyourlife a hellof a loteasier.
Sowiththat, let's goovertothecomputer, and I cangiveyou a demonstrationofhowthesecomparisonoperatorswork.
Sothisis a verysimplecomparisonoperatorscript.
Basically, thisisjust a waytosayhellotosomebodyiftheycometoyourwebsiteandmakethemfeelasifit's a littlepersonalizedandthendecidebasedontheirage, whetherornotthey'reallowedenter.
Sointhis, obviouslyweopenedupwiththePHPtag, andthefirstthingthatwe'regoingtodoiswe'regoingtocreate a dollarsignnameas a variable.
Andforthefirsttest, we'regoingtosetittoBob.
Now, whenyouset a variableinPHP, it's importantthatyouusethedoublequotationmarks.
Andthen, ofcourse, youclosewith a semicolonwerethenalsogoingtocreatethevow, thevariableage, andcurrentlywe'regoingtosetthatvalueto 20.
Soifit's twoequalsigns, itmeansisitequaltorememberifyouonlyputin a oneequalsignthat's goingtotrytosetthevalueofthevariabletowhatitis?
Sooneequalsignwillsetthevalueof a variabletoequalsigns, questions, whetherthetwoareequal.
Andthenwhenwe'regoingtobedoingthis, whetherit's a looporwhetherit's inthe F statement, we'regoingtouse a singlequotationmarkfor a stringandwe'regoingtoputinBob.
Sothesearethecomparisonoperators, andthiscangiveyou a betterideaofsomeoftheothercomparisonoperatorssomethingforyoutobethinkingabout.
Ifyou'rewalkingthisparticularvideo, I wouldstayverysimple, equaltoandnotequaltogreaterthanlessthanequaltoorgreateraregreaterthanorequaltoorlessthanorequalto.