src/Lablog/Lablog/Post/JsonPostConfig.php
public function strip($postContent, $wrap)
    {
        $pattern = '/'.$wrap.'(.*?)'.$wrap.'/s';
        $match = preg_match($pattern, $postContent, $matches);

        if ($match) {
            $post['config'] = $matches[1];
            $post['content'] = str_replace($matches[0], '', $postContent);
            return $post;
        }

        return array('config' => '', 'content' => $postContent);
    }
public function strip($postContent, $wrap)
    {
        $pattern = '/'.$wrap.'(.*?)'.$wrap.'/s';
        $match = preg_match($pattern, $postContent, $matches);

        if ($match) {
            $post['config'] = $matches[1];
            $post['content'] = str_replace($matches[0], '', $postContent);
            return $post;
        }

        return array('config' => '', 'content' => $postContent);
    }
public function strip ( $ postContent , $ wrap ) { $ pattern = '/' . $ wrap . '(.*?)' . $ wrap . '/s' ; $ match = preg_match ( $ pattern , $ postContent , $ matches ) ; if ( $ match ) { $ post [ 'config' ] = $ matches [ 1 ] ; $ post [ 'content' ] = str_replace ( $ matches [ 0 ] , '' , $ postContent ) ; return $ post ; } return array ( 'config' => '' , 'content' => $ postContent ) ; }
Strip the config from the post and return the config and content
in an array.
@param  string $postContent
@param  string $wrap
@return array
Strip the config from the post and return the config and content in an array .