Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

87
Views
PHP function with parameter

I am trying to execute a php "runMyFunction($para)" function which takes in a string parameter when clicking on an image

 echo '<a href="index.php?similair=true"><img src="'. $location. '" alt="'. $name, '"     />';

and my php funtion is

 function runMyFunction($input) {
    echo  $input;
  }

  if (isset($_GET['similair'])) {
    runMyFunction();
  }

My question is how can I pass another string value so I can use it inside the $_GET checking part to pass it as a parameter in my function

Any help would be much appreciated

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Assuming you want a second parameter named param2 and you want pass the value 'test'

echo '<a href="index.php?similair=true&param2=test">
            <img src="'. $location. '" alt="'. $name, '"     />';


  function runMyFunction($input) {
      echo  $input;
    }

    if (isset($_GET['similair'])) {
      runMyFunction( $_GET['param2']);
    }
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!