george Posted January 15, 2008 Share Posted January 15, 2008 Can't use function return value in write context in C:\www\www.cancerproject.org\htdocs\AdminCMS\SaveEditEvent.php on line 33 Ok, so how can I find if a substring exists within a string, so I can get along with my life? Here is line 33 if ((strpos($MyKey,'EDCancel')=1) AND ($item=='true')) { ... blah ... } I'm not sure what makes this a write context. But how do I correct it?I just want to see if "EDCancel" exists in $MyKey, and begins the string. I am using this within an array_walk using POSTed values. TIA Link to comment Share on other sites More sharing options...
justsomeguy Posted January 15, 2008 Share Posted January 15, 2008 if (strpos($MyKey,'EDCancel') !== false)That will find if it exists at all. If you want to find if it starts the string you can do this:if (strpos($MyKey,'EDCancel') === 0) Link to comment Share on other sites More sharing options...
george Posted January 16, 2008 Author Share Posted January 16, 2008 Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.