<mySearch ⁄>
<mySnippets order="rand" ⁄>
<myContacts ⁄><email ⁄>
<windows live messenger ⁄>
<myCurriculum type="pdf" ⁄>
<myBlog show="last" ⁄>
<myNews show="rand" ⁄>
<myNews type="cat" ⁄>
<myQuote order="random" ⁄>Aquele que não sabe e pensa que sabe, é um tolo: Fuja dele. Aquele que sabe e pensa que não sabe, está a dormir: Acorde-o. Aquele que não sabe e sabe que não sabe, é humilde: Guie-o. Aquele que sabe e sabe que sabe, é um mestre: Siga-o.
<myPhoto order="random" ⁄>
<myAdSense ⁄>
<myVisitorsMap ⁄>
<?php /** * Obter os n 1os caracteres de uma string * * @param String * @param int - quantos caracteres? * @return String */ function left ($str, $howManyCharsFromLeft){ return substr ($str, 0, $howManyCharsFromLeft); } /** * Obter os n últimos caracteres de uma string * * @param String * @param int - quantos caracteres? * @return String */ function right ($str, $howManyCharsFromRight){ return substr ($str, $strLen - $howManyCharsFromRight, strlen ($str)); } /** * Obter uma parte intermediária da String * * @param String * @param int - começa em que posição? nota: a posição inicial é o 0 * @param int - acaba em que posição? * @return String */ function mid ($str, $startAt, $until){ return substr ($str, $startAt, $until); } //exemplos $str="Olá Mundo"; echo left($str,3); //retorna 'Olá' echo right($str,5); //retorna 'Mundo' echo mid($str,1,6); // retorna 'lá Mun' // ?>