This topic is locked
[SOLVED]

 recursive function

4/9/2019 2:31:25 PM
PHPRunner General questions
E
edossa author



[color=#212121]how can I insert a recursive function in before record added?

A
ayctech 4/9/2019

before record added or custom add

E
edossa author 4/9/2019

Hi

[size="2"]I insert the function in custom add, does not see it .. what am I wrong?[/size]
) {

global $dal;

[/size][/font];

while ([/size][/font]) {

[/size][/font]"SELECT idutentepadre FROM livelli

WHERE idutente = [/size][/font];
[/size][/font]);
[/size][/font]);
if ([/size][/font]) {

[/size][/font];

}

return [/size][/font];

}
}[/size][/font]

A
ayctech 4/10/2019

I do not understand very well what you want to do, do you want to call that function from somewhere?

E
edossa author 4/10/2019



[color="#1C2837"]

A
ayctech 4/10/2019

that function you want to place in custom add but where do you want to call it?

E
edossa author 4/10/2019
A
ayctech 4/10/2019

example
custon add
function sanear_string($string)

{
$string = trim($string);
//Esta parte se encarga de eliminar cualquier caracter extraño

$string = strreplace(

array('.','
') ,array(''),

$string

);
return $string;

}
$values['precio_total_compras']=sanear_string($values['precio_total_compras']);

admin 4/14/2019

This is how you can add an external PHP file with function definitions:

https://xlinesoft.com/phprunner/docs/how_to_add_external_files.htm
Then you can just call your PHP functions anywhere in the events code.