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 zephirmemstrstr call php_memnstr().

What is memstr() in php?



84.0k
Accepted
answer

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



5.8k

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