Sten Posted November 18, 2022 Share Posted November 18, 2022 Hi, I am perplex as I compare the content of a description field of a file ($page->parent()->formulaires_papier) and the option chosen in an other page ($page->categorie_de_formation->title). When I have a real string it is OK but when I compare the two fields they never match although I checked up the string perfectly matches. The choice is only for one option. Here is my code <?php $cat=trim($page->categorie_de_formation->title); foreach ($page->parent()->formulaires_papier as $formulaire){ $description=trim($formulaire->description); if ($cat==$description OR $description=="Réglement intérieur"){ echo "<a href='$formulaire->url'>$formulaire->description</a>"; } } ?> I tried many things but it still bugs... Thank you Link to comment Share on other sites More sharing options...
Sten Posted November 19, 2022 Author Share Posted November 19, 2022 A problem of HTML entities. 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