Reply to Re: use C constant in php

Your name:

Reply:


Posted by NC on 09/27/98 11:44

wong_powah@yahoo.ca wrote:
>
> I define some constants in C header file.
> e.g.
> const int MAX = 10;
>
> How do I use the same value of MAX in php without redefining
> MAX in php?
> i.e. it involve how php interact with functions and libraries written
> in other languages, such as C.

Generally speaking, PHP cannot interact with random code. If you want
PHP to use entities defined in C, you must write a PHP extension and
ensure PHP is configured to use that extension.

Alternatively, you could just have your C program set some environment
variables; they will be accessible to PHP as members of the $_ENV
superglobal array.

Other alternatives include using shared memory (only on Unix) and
wrapping your C program into a Web service...

Cheers,
NC

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация