Update chainer.php

Added extract function