• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

540/php-koans

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

540/php-koans

开源软件地址:

https://github.com/540/php-koans

开源编程语言:

PHP 100.0%

开源软件介绍:

PHP koans

Run: composer install


Variables:

Properties:

  • A variable starts with the $ sign, followed by the name of the variable
  • A variable name must start with a letter or the underscore character
  • A variable name cannot start with a number
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  • Variable names are case-sensitive ($age and $AGE are two different variables)

Exercises

  • DeclareAnInt

    • An integer must have at least one digit
    • An integer must not have a decimal point
    • An integer can be either positive or negative
    • Integers can be specified in: decimal (base 10), hexadecimal (base 16), octal (base 8), or binary (base 2) notation
  • DeclareABoolean

    • A Boolean represents two possible states: TRUE or FALSE.
  • DeclareAFloat

    • A float (floating point number) is a number with a decimal point or a number in exponential form.
  • DeclareAnArray

    • An array stores multiple values in one single variable.
  • DeclareAConstant

  • DeclareAGlobalVariable

  • DeclareAnIntWithNullValue

  • AssignAVariableValueToAnotherVariable

  • CastStringIntToBoolean

  • ###Do the same defining return types


Strings

Properties

  • A string is a sequence of characters, like "Hello world!".

Exercises

  • Strings definition:

    • DoubleQuotedStringsAreStrings
    • SingleQuotedStringsAreAlsoStrings
    • UseBackslashForEscapingQuotesInStrings
    • DotConcatenatesStrings
    • DotWorksWithVariables
    • DotEqualsAppendsToEndOfString -> .=
  • String manipulation:

    • getTheLengthOfAString
    • CountWordsInAString
    • ReverseAString
    • SearchForATextWithinAString
    • ReplaceTextWithinAString

Operators

Properties

  • Operators are used to perform operations on variables and values.

Exercises

  • Arithmetic Operators:

    • Add
    • Subtract
    • Multiplicate
    • Divide
    • Module
    • Exponent
  • AssignmentOperators:

    The PHP assignment operators are used with numeric values to write a value to a variable. The basic assignment operator in PHP is "=". It means that the left operand gets set to the value of the assignment expression on the right.

    • AssignVariableToAnotherVariable
    • AddVariableToAnotherVariable
    • MultiplyVariableToAnotherVariable
    • DivideVariableByAnotherVariable
    • ModuleVariableByAnotherVariable
  • Comparison Operators:

    The PHP comparison operators are used to compare two values (number or string)

    • Equal
    • Identicla
    • NotEqual
    • NotIdentical
    • GreaterThan
    • LessThan
    • GreaterThanOrEqualTo
    • LessThanOrEqualTo



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap