Hello, I want to compare two strings and show a message if they are different or not, I'm using the strcmp function (in a custom HTML box) but it seems not to work, here is the code:
<?php
$str1 = "{var:read_data.tblx.FirtField}";
$str2 = "{var:read_data.tlby.SecondField}";
echo strcmp($str1, $str2); // if it work in here I'll add the IF THEN condition
?>
The result is always -10 wherever the two fields are identical or not, I've tried to echo both $str1 and $str2 just to be sure they are read correctly and they are, if I change to:
<?php
$str1 = "a";
$str2 = "a";
echo strcmp($str1, $str2);
?>
I got 0 as result (and any other result if I change the strings), where I'm wrong?
<?php
$str1 = "{var:read_data.tblx.FirtField}";
$str2 = "{var:read_data.tlby.SecondField}";
echo strcmp($str1, $str2); // if it work in here I'll add the IF THEN condition
?>
The result is always -10 wherever the two fields are identical or not, I've tried to echo both $str1 and $str2 just to be sure they are read correctly and they are, if I change to:
<?php
$str1 = "a";
$str2 = "a";
echo strcmp($str1, $str2);
?>
I got 0 as result (and any other result if I change the strings), where I'm wrong?