Sunday 15 June 2014

visual c++ - How to pass string,int,char and print them when we are using zend function in php? -


I am trying to create a php extension in which I pass string, int, my CCP file. My Zend function in .cpp file is like this:

  # PHP_COMPILER_ID "VC9" #include "php.h" Include ZEND_FUNCTION (use_html); Zend_function_entry use_functions [] = {ZEND_FE (use_html, NULL) {NULL, NULL, NULL}}; Zend_module_entry use_html_module_entry = {STANDARD_MODULE_HEADER, "Use HTML", use_function, zero, zero, zero, zero, zero, "1.0.0 - tutorial", STANDARD_MODULE_PROPERTIES}; ZEND_GET_MODULE (use_html); ZEND_FUNCTION (use_html) {int useHtml; Four * f; Int a = 10, b = 120, c; If (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC, "/", and useHtml) == Failure) {E_ERROR; Return; } C = A + B; Php_printf ("is yoga", and use html); Php_printf ("This string is% d:" + useHtml); If (useHtml == 1) {php_printf ("\ nThis string uses   

and php code:

  & lt ;? Php use_html (1); // use_html ("hi"); For passing the string? & Gt;   

But how does it work with PHP and how to print in the zend function?

The error is such:

  (!) Screen: Ignore for Error Suppression (!) Warning: use_html () Expected that criteria 1 unknown , Is given in the integer: line 3 call stack at D: \ wamp \ www \ test.php # time memory function location 1 0.0006 138008 {main} () .. \ test.php: 0 2 0.0006 138352 use_html (). . Test.php: 3    

turn this part:

  if you should specify the expected (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC, "/", and useHtml) == failure   

To accept every type of type where "/" is, you can use "z", but to reach four *, long, double values, you must use a macro or such check The value must be converted to a string.

No comments:

Post a Comment