-3

I want to make some changes on a php file. What does this statement mean?:

if(($aEbtVarSet["ebt_swift"] == '') || ($aEbtVarSet["ebt_swift"] != $_POST['sepabanktransfer_swift']))
    $aEbtVarSet["ebt_swift"] = $_POST['sepabanktransfer_swift'];
Shawn Mehan
  • 4,513
  • 9
  • 31
  • 51
Tatar Jony
  • 69
  • 1
  • 8

3 Answers3

0

($aEbtVarSet["ebt_swift"] == '') || ($aEbtVarSet["ebt_swift"]

$a || $b Or TRUE if either $a or $b is TRUE.

($aEbtVarSet["ebt_swift"] != $_POST['sepabanktransfer_swift'])

! $a Not TRUE if $a is not TRUE.

More about logical operators in PHP

alejus
  • 189
  • 1
  • 3
0

If the variable $aEbtVarSet["ebt_swift"] is empty, or the POST input ebt_swift is different from its current value, it replaces the value with the POST input.

Barmar
  • 741,623
  • 53
  • 500
  • 612
0

It basically means that if the $aEbtVarSet["ebt_swift"] variable is empty but set OR the same $aEbtVarSet["ebt_swift"] variable is different than the $_POST['sepabanktransfer_swift'] which is most likely set by a user with an <input> tag, then it will set the first variable to match the one sent by the user (replace/overwrite its previous value).

Zeke
  • 1,281
  • 1
  • 18
  • 26
  • Thanks for the answer. And ow can I rewrite this one to have something that is comparable with LIKE and not with different? – Tatar Jony Dec 28 '15 at 16:54
  • You can do that with the `strpos()` function http://php.net/manual/en/function.strpos.php. You might find http://stackoverflow.com/questions/4366730/check-if-string-contains-specific-words useful. You just have to play along with it... – Zeke Dec 28 '15 at 16:59