Return to Snippet

Revision: 5300
at February 25, 2008 14:49 by nijgnet


Updated Code
/*
 * Replaces align parameter with a class style.
 * Example: align="left" -> class="alignleft"
 * 
 * @param $html String: html code of <img>
 * @return $html String: modified html code
 */
function rewrite_imgalign ($html)
{
    return preg_replace('/align=\"(\w+)\"/i', 'class="align${1}"', $html);
}

Revision: 5299
at February 25, 2008 14:49 by nijgnet


Initial Code
/*
 * Replaces align parameter with a class style.
 * Example: align="left" -> class="alignleft"
 * 
 * @param $html String: html code of <img>
 * @return $html String: modified html code
 */
function rewrite_imgalign ($html)
{
    return preg_replace('/align=\"(\w+)\"/i', 'class="align${1}"', $html);
    //return $html;
}

Initial URL


Initial Description


Initial Title
Rewrites align parameter to a class style

Initial Tags
css

Initial Language
PHP