// Most effective way to call a javascript function with parameter of PHP variable echo '<input type="button" value="Button" onclick="return openEditor('' . $path_image . '')">';