PHP: cannot matching string "<br />
- by Patrick
hi,
I'm having problems with string matching in PHP.
I've 2 html elements in my page, I've copy pasted here the content with Firebug
<div class="field-item odd">
<div class="field-label-inline-first">
Year:</div>
2009 </div>
<div class="field-item odd">
<div class="field-label-inline-first">
Synopsis:</div>
<br />
</div>
This php line works perfectly (the element with 2009 is detected)
<?php if ($items[0]['view'] == '2009') : echo "ok"; ?>
However I'm not able to match the string containing element:
<?php if ($items[0]['view'] == '<br />') : echo "ok"; ?> //doesn't work
<?php if ($items[0]['view'] == '<br />') : echo "ok"; ?> //again doesn't work
any tip ?
To give you some context:
The strings are produced by CKEditor, an editor I'm using in my Drupal back-end. When I leave empty this editor, the tag is displayed on the string as plain text (because I set "plain text" as formatting option in the back-end)
Thanks