[PHP] explode()時の Notice: Undefined offset の解決方法2015/12/21•1 min readPHP43目次文字列を区切る関数。概要$str = "ab"; list($a, $b) = explode(',', $str); こういう場合、以下の様なエラーが発生する。NOTICE Undefined offset: 1 on line number 3解決方法array_pad()を使って埋める。以下の様な感じで埋める。list($a, $b) = array_pad(explode(',', $str), 2, null);