moves echo out of php function definition code block