iNoize Posted September 10, 2015 Share Posted September 10, 2015 Hello, i have several groups as pages for objects. called $gruppe echo $gruppe // delivers eg 1045| 1043 |1041 how can i check for example if($gruppen ~= "1045"){echo "in the gruop ";} which is the right way to check this ? Tnx Link to comment Share on other sites More sharing options...
LostKobrakai Posted September 10, 2015 Share Posted September 10, 2015 // works with keys / selectors // will return null if not present if($pageArray->get(1045)) //do something; if($pageArray->get("id=1045")) //do something; // Works for the above types and also // if you've already an page object to compare if($pageArray->has($page)) //do something; You'll find both of them here: http://cheatsheet.processwire.com/ 1 Link to comment Share on other sites More sharing options...
iNoize Posted September 10, 2015 Author Share Posted September 10, 2015 Thanks a lot ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now