public function readBorder($css)
    {
        // border none
        $none = array('type' => 'none', 'width' => 0, 'color' => array(0, 0, 0));

        // default value
        $type  = 'solid';
        $width = $this->convertToMM('1pt');
        $color = array(0, 0, 0);

        // clean up the values
        $css = explode(' ', $css);
        foreach ($css as $k => $v) {
            $v = trim($v);
            if ($v) $css[$k] = $v;
            else    unset($css[$k]);
        }
        $css = array_values($css);

        // read the values
        $res = null;
        foreach ($css as $value) {

            // if no border => return none
            if ($value=='none' || $value=='hidden') {
                return $none;
            }

            // try to convert the value as a distance
            $tmp = $this->convertToMM($value);

            // if the convert is ok => it is a width
            if ($tmp!==null) {
                $width = $tmp;
            // else, it could be the type
            } else if (in_array($value, array('solid', 'dotted', 'dashed', 'double'))) {
                $type = $value;
            // else, it could be the color
            } else {
                $tmp = $this->convertToColor($value, $res);
                if ($res) $color = $tmp;
            }
        }

        // if no witdh => return none
        if (!$width) return $none;

        // return the border properties
        return array('type' => $type, 'width' => $width, 'color' => $color);
    }
public function readBorder($css)
    {
        // border none
        $none = array('type' => 'none', 'width' => 0, 'color' => array(0, 0, 0));

        // default value
        $type  = 'solid';
        $width = $this->convertToMM('1pt');
        $color = array(0, 0, 0);

        // clean up the values
        $css = explode(' ', $css);
        foreach ($css as $k => $v) {
            $v = trim($v);
            if ($v) $css[$k] = $v;
            else    unset($css[$k]);
        }
        $css = array_values($css);

        // read the values
        $res = null;
        foreach ($css as $value) {

            // if no border => return none
            if ($value=='none' || $value=='hidden') {
                return $none;
            }

            // try to convert the value as a distance
            $tmp = $this->convertToMM($value);

            // if the convert is ok => it is a width
            if ($tmp!==null) {
                $width = $tmp;
            // else, it could be the type
            } else if (in_array($value, array('solid', 'dotted', 'dashed', 'double'))) {
                $type = $value;
            // else, it could be the color
            } else {
                $tmp = $this->convertToColor($value, $res);
                if ($res) $color = $tmp;
            }
        }

        // if no witdh => return none
        if (!$width) return $none;

        // return the border properties
        return array('type' => $type, 'width' => $width, 'color' => $color);
    }
public function readBorder ( $ css ) { // border none $ none = array ( 'type' => 'none' , 'width' => 0 , 'color' => array ( 0 , 0 , 0 ) ) ; // default value $ type = 'solid' ; $ width = $ this -> convertToMM ( '1pt' ) ; $ color = array ( 0 , 0 , 0 ) ; // clean up the values $ css = explode ( ' ' , $ css ) ; foreach ( $ css as $ k => $ v ) { $ v = trim ( $ v ) ; if ( $ v ) $ css [ $ k ] = $ v ; else unset ( $ css [ $ k ] ) ; } $ css = array_values ( $ css ) ; // read the values $ res = null ; foreach ( $ css as $ value ) { // if no border => return none if ( $ value == 'none' || $ value == 'hidden' ) { return $ none ; } // try to convert the value as a distance $ tmp = $ this -> convertToMM ( $ value ) ; // if the convert is ok => it is a width if ( $ tmp !== null ) { $ width = $ tmp ; // else, it could be the type } else if ( in_array ( $ value , array ( 'solid' , 'dotted' , 'dashed' , 'double' ) ) ) { $ type = $ value ; // else, it could be the color } else { $ tmp = $ this -> convertToColor ( $ value , $ res ) ; if ( $ res ) $ color = $ tmp ; } } // if no witdh => return none if ( ! $ width ) return $ none ; // return the border properties return array ( 'type' => $ type , 'width' => $ width , 'color' => $ color ) ; }
Analyse a border

@access  public
@param   string $css css border properties
@return  array  border properties
Analyse a border