We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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?



98.9k
Accepted
answer

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



9.0k

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".