-2

From a method I get a array value as return, the method is like this:

 $block->getQuantityValidators();

With print_r:

 Array ( [required-number] => 1 [validate-item-quantity] => Array ( [minAllowed] => 0.5 [maxAllowed] => 10000 ) )

How to echo only the value of "minAllowed"

Jilco Tigchelaar
  • 2,065
  • 8
  • 31
  • 51
  • `$arr = $block->getQuantityValidators(); echo $arr['validate-item-quantity']['minAllowed'];` try this – Umer Abbas Apr 26 '20 at 15:09
  • 1
    Read the accepted answer in the linked question, that will teach you something, unlike the answers here. – Andreas Apr 26 '20 at 15:31

1 Answers1

0
$quantityValidators = $block->getQuantityValidators();
echo $quantityValidators['validate-item-quantity']['minAllowed'];
Shawn Barratt
  • 472
  • 3
  • 9