/ LJCPHPCodeDoc / LJCCommonLib / LJC / HasDiff


Parameters
$result - The result value.
$compare - The compare to value.

Returns

true if the strings are different; otherwise false.

Syntax

PHP
public static function HasDiff(string $result, string $compare): bool

Checks if two strings are different.

Example

PHP
 // Checks if two strings are different.
 private static function HasDiff()
 {
   $result = "This is the first line.\n";
   $result .= "This is the second line.\n";
 
   $compare = "This is the first line.\n";
   $compare .= "This is the second line.\n";
   if (LJC::HasDiff($result, $compare))
   {
     echo("\r\n\r\nHasDiff()");
     LJC::ShowFirstDiff($result, $compare);
   }
 }

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.