Skip to content

Tag: c#

How can I get PHP to sign an input exactly the same as C#?

I’m working with an older API that requires XMLs to be signed. There is no proper documentation and the only code example was given in C#. I need to port this example to PHP. However, the code I’ve written in PHP gets a different output even when provided with the same input, causing the API call …

php-ffi: Assign char* of a struct

I’m trying to set the value of a char* of a struct. This is a basic example: I’m getting an exception: FFIException: Incompatible types when assigning to type ‘char*’ from PHP ‘string’ My question is: How to set the char *name of a struct? My dirty way was to make an array …

Fastest reimplementation PHP’s htmlspecialchars function in C

I need the default behaviour (i.e ENT_COMPAT | ENT_HTML401) of the PHP-function htmlspecialchars() in C, how is this done best (that means fastest) in C? I don’t need the input string, therefore an in-place solution is possible. It is a really simple function, it just converts these characters: What str…