We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

what is memstr()

phalcon 2.0.0 call memstr() function.

In cphalcon memstr call zephir_memstr_strint zephir_memnstr_str(const zval *haystack, char *needle, unsigned int needle_length ZEPHIR_DEBUG_PARAMS).

And zephir_memstr_str call php_memnstr().

What is memstr() in php?


It's like strpos but it returns 1 if it finds the needle in the haystack and 0 if it does not.


so the php equivalen for memstr($mystring, $findme) is (strpos($mystring, $findme) !== false)

Thanks, I was trying to do some "dumb" porting of code in zephir into php (mssql adapter, based on mysql one).

Would be nice to add the PHP equivalent to these Zephir primitives, like "fetch".