Building a new module
| From: | epplestun | Date: | Wed, 16 Oct 2002 22:54:45 +0000 |
| Subject: | Building a new module | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2548@lists.php.net to get a copy of this message | ||
Hi, i'm trying to make my own module for PHP, i do me first module and work very well, now i want to receive the argumets of me function. For example now i have this and work well:
PHP_FUNCTION(epplestun)
{
int i;
for(i=0,i<5,i++) {
printf("Hello world\n");
}
RETURN_FALSE;
}
I want to have this:
PHP_FUNCTION(epplestun)
{
int id;
if(1 == ZEND_NUM_ARGS() && SUCCESS == zend_get_parameters_ex(1, &id)) {
printf("%i",id);
}
RETURN_FALSE;
}
In PHP like this:
function ($i){
echo $i;
}
The code of C is well to receive arguments?¿? for example, if i put: epplestun(2); this return the number 2?
thx :-)