Reply to Re: [PHP] Re: editor that typesets the php code

Your name:

Reply:


Posted by Philip Hallstrom on 04/28/05 20:33

> well, i'm not sure what to do after your code is done, but as far as
> editors go, theres a free one out there that does syntax highlighting
> for a ton of languages (php included) called Vim... it comes with a
> graphical version called gvim that i do all of my coding on. no
> debugging features for php (afaik) but you can set up debuggers
> through vim (never tried though). http://www.vim.org

Open up the file in vim and type:

gg=G

Turns this:

------------------------------------------------------------------------------------------------
function str_pad_html($strInput = "", $intPadLength, $strPadString =
" ") {
if (strlen(trim(strip_tags($strInput))) < intval($intPadLength)) {

switch ($intPadType) {
// STR_PAD_LEFT
case 0:
$offsetLeft = intval($intPadLength - strlen(trim(strip_tags($strInput))));
$offsetRight = 0;
break;

// STR_PAD_RIGHT
case 1:
$offsetLeft = 0;
$offsetRight = intval($intPadLength -
strlen(trim(strip_tags($strInput))));
break;
}

unset($strInput, $offsetLeft, $offsetRight);

return $strPadded;
}

else {
return $strInput;
}
}
------------------------------------------------------------------------------------------------

into this:

------------------------------------------------------------------------------------------------

function str_pad_html($strInput = "", $intPadLength, $strPadString = "&nbsp;") {
if (strlen(trim(strip_tags($strInput))) < intval($intPadLength)) {

switch ($intPadType) {
// STR_PAD_LEFT
case 0:
$offsetLeft = intval($intPadLength - strlen(trim(strip_tags($strInput))));
$offsetRight = 0;
break;

// STR_PAD_RIGHT
case 1:
$offsetLeft = 0;
$offsetRight = intval($intPadLength - strlen(trim(strip_tags($strInput))));
break;
}

unset($strInput, $offsetLeft, $offsetRight);

return $strPadded;
}

else {
return $strInput;
}
}


------------------------------------------------------------------------------------------------

-philip

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация