php call function when connected to file

421

I've try to call a function in php. I've connected with an ajax call to the file (works fine). My question in now how can I call the function?

if (isset($_POST['callFunc1']) && !empty($_POST['callFunc1'])) {
    echo 'get the echo';
    function generateWigaNews()
    {
        echo 'don't get the echo';
    }
} 
568

Answer

Solution:

if (isset($_POST['callFunc1']) && !empty($_POST['callFunc1'])) {
    echo 'get the echo';
    function generateWigaNews()
    {
        echo "don't get the echo";
    }
    generateWigaNews() //call function
} 

People are also looking for solutions to the problem: PHP/XML Garbled text

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.