Well, yes and no... you must echo the output of the function calls in order
for the AJAX call to get the information... you can do something like this
though, to hold off echoing until the end of the file. I've also included
the exit command, because you generally don't want any other information
outputted once your function has run:

<?php

function func1() {return 'Hello from 1';}
function func2() {return 'Hello from 2';}
function func3() {return 'Hello from 3';}

switch($_GET['func']) {
  case '1':
    $output = func1();
    break;
  case '2':
    $output = func2();
    break;
  case '3':
    $output = func3();
    break;
  default:
    $output = '';
}

// Do other things...

echo $output;
exit;

?>



On Dec 17, 2007 7:45 PM, uraz <[EMAIL PROTECTED]> wrote:

>
> I have just one more question. Is it possible to use "return" instead
> of "echo" in php function to pass some data back?
>

Reply via email to