Home / Learn / PHP Basics / PHP Functions

PHP Functions

Learn how to define PHP functions

3 years ago

113

Code Example

<?php

function fullName() {
	return "John Doe";
}

function calculateAge() {
	return 10 + 13;
}

function greet($name) {
	return "Hi " + $name;
}

echo fullName(); // John Doe

echo calculateAge(); // 23

echo greet(fullName()): // Hi John Doe
                    

Code Snippets

Collection of Laravel, AlpineJS, VueJS, Tailwind CSS, Flutter snippets and more. New snippets added every day.
View Snippets

Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your web projects
View Components

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this