Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8579763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:40:47+00:00 2026-06-11T20:40:47+00:00

This is my first question so please be patience.This question may sounds childish but

  • 0

This is my first question so please be patience.This question may sounds childish but I really want to know that what is a function in programming? How they are defined and how they are called to execute. I am just learning php. I have seen many functions like this

function myfunction () {
 --------
 --------
}

and another type function like this

function myfunction (some variables) {
------------
------------
}

I want to know what is the difference in between them? Any help and suggestions or any valuable link will be more appreciated. Before down voting this question any comments or any good learning link will be more helpful to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:40:49+00:00Added an answer on June 11, 2026 at 8:40 pm

    Those functions are exactly the same except for what they are provided (in terms of data). The first one requires no variables to be passed to it externally to run.

    The second one has variables it does use that are passed from it externally, however, these may not be required as default values can be set for these variables.

    A function in programming is used to perform a repetitive task, such as removing underscores from a string and making the first letter of each word a capital.

    To define a variable, the simplest way is to do this:

    function my_function () {
      // Function code here
    }
    

    To call this function, you need to make sure it is accessible (e.g. included on the page), you simply do:

    my_function();
    

    That will execute the function and potentially return it’s results.

    You can also pass variables to functions as stated, but I recommend looking up tutorials on PHP functions.

    https://www.google.co.uk/search?q=PHP+Functions … lots of results for you 🙂

    This explanation is PHP specific, other languages may vary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First question on SOF, please be gentle if this may be a stupid question.
This is my first question so please be gentle. :-) I know AspectJ can
This is my first question, so please be gentle. I'm trying out Apache Camel
This is my first post on stackoverflow, so please excuse me if my question
This is my first question on Stack Overflow, so I hope that I'm clear
This is my first question, but I've already found this site extremely helpful, so
This is my first question her so please be gentle: I have followig animation
my first question is, where do I put this custom extension so that it
This question is similar to my previous question but not the same ... please
This is my first question, hence please ignore mistakes, if any. I have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.