Re: Manipulating parameter values
| From: | Pierre Joye | Date: | Sun, 04 May 2008 18:26:02 +0000 |
| Subject: | Re: Manipulating parameter values | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-5444@lists.php.net to get a copy of this message | ||
hi,
On Sun, May 4, 2008 at 10:12 AM, Mathias Gisch
<mathias.gisch@t-online.de> wrote:
> Hi,
>
> I am new to extension programming in php, and I hope you can help me. I want
> to achieve that I can manipulate the parameters given to my extension
> functions. I have a function that replaces text. I want that function to
> return the number of replacements, and to manipulate the string given to the
> function.
> To retrieve the parameters i use zend_parse_parameters(ZEND_NUM_ARGS()
> TSRMLS_CC, ³s², &str, &str_len). But if I manipulate the str variable this
> change is not passed to the php-caller-script.
> Do you have any ideas?
You mean to pass a value by reference?
See:
http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?revision=1.7.6.2.2.3&view=markup
All options with examples are described in this doc.
I hope it helps,
--
Pierre
http://blog.thepimp.net | http://www.libgd.org