B
B
Bodya_idiot2020-05-22 20:05:10
PHP
Bodya_idiot, 2020-05-22 20:05:10

Why is the error Cannot redeclare Any function() previously declared in home/etc?

Why is the error Cannot redeclare funuia() previously declared in /home/etc.
Moreover, this error occurs on the last function, for example:

<?php

include 'index.php';

$page = 1;

function getRestsFromPage($page)
{
'some code';
}

function GetMaxPage($page)
{
'some code';
}

function getpdo()
{
'some code';
}

and the error is Cannot redeclare getpdo() previously declared in /home/etc.
But, if I put one more function, absolutely any one, let's say:

<?php

include 'index.php';

$page = 1;

{
'some code';
}

function GetMaxPage($page)
{
'some code';
}

function getpdo()
{
'some code';
}
function syka_yshe_2cahsa_sishy_nad_etoi_hernoi()
{
'some code';
}

Then it gives me:
Cannot redeclare syka_yshe_2cahsa_sishy_nad_etoi_hernoi() previously declared in /home/etc.

Here's the trick, help if you can

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-05-22
@Bodya_idiot

Use include_once() .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question