Jump to content

[SOLVED] Not able to compare a select option title to a file description


Sten
 Share

Recommended Posts

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

  • Sten changed the title to [SOLVED] Not able to compare a select option title to a file description

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...