---
title: "Discussion on \"PHP: Function, Conditionals and Scope\" | Hashnode"
description: "Discussion on \"PHP: Function, Conditionals and Scope\". Function Definition\nA function is defined using the 'function' keyword similar to JavaScript.\nfunction myFun()\n{\n    echo \"Hello World\";\n}\n// Output: Hello World\nmyFun();\n\nDefault Parameter\nThe parameters in a function can be given a default value wh..."
url: "https://hashnode.com/posts/php-function-conditionals-and-scope/652a8062a694de59573e1651"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [PHP: Function, Conditionals and Scope](https://giver-kdk.hashnode.dev/php-function-conditionals-and-scope?utm_source=hashnode&utm_medium=feed)

Function Definition A function is defined using the 'function' keyword similar to JavaScript. function myFun() { echo "Hello World"; } // Output: Hello World myFun(); Default Parameter The parameters in a function can be given a default value wh...

Oct 14, 2023 · 2 min read · giver-kdk.hashnode.dev  
Updated Nov 25, 2023  
Read the article

-   [#conditional-statement](https://hashnode.com/tag/conditional-statement)
-   [#functions](https://hashnode.com/tag/functions)
-   [#variable-scope](https://hashnode.com/tag/variable-scope)
-   [#global-variables](https://hashnode.com/tag/global-variables)
-   [#php-function](https://hashnode.com/tag/php-function)

## Written by

[Giver Kdk](https://hashnode.com/@Giver)

@Giver · Kathmandu, Nepal

  
[View profile](https://hashnode.com/@Giver)

Music, Coding and Nature

I am a guy who loves building logic.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
