Jump to content

kingless

Member
  • Posts

    1,061
  • Joined

  • Last visited

kingless's Achievements

void

void (1/5)

  • 1 Year

Recent Badges

0

Reputation

  1. kingless

    paragrafo ereg

    Faltava uma expressão regular no meu 1º exemplo... <?php $nome = "sousa martins"; $nome = nl2br( $nome ); preg_match( '/sousa(.*)martins/s', $nome, $match ); print_r( $match );
  2. kingless

    paragrafo ereg

    Utiliza preg_match em vez de ereg <?php $nome = "sousa martins"; preg_match( '/sousa martins/s', $nome, $match ); print_r( $nome );
  3. Esse hack é totalmente compatível com php 4 e php 5 e não é preciso utilizar outros nomes para as funções... esse hack até é utilizado pelo Joomla 1.5 e por um dos melhores php frameworks o Cake PHP.
  4. É possivel simular o __construct e __destruct no PHP 4 utilizando um hack... class nova extends hack { function __construct() { echo '__contruct'; } function comer() { } function beber() { } function dormir() { } function __destruct() { echo '__destruct'; } } $objecto = new nova(); class hack { function hack() { $args = func_get_args(); call_user_func_array(array( &$this, '__construct' ), $args ); if(method_exists( $this, '__destruct' )) { register_shutdown_function(array( &$this, '__destruct' )); } } function __construct () {} function __destruct () {} } EDIT: btw, djthyrax em alguns posts tens __destroy em vez de __destruct...
  5. Adiciona depois do $result = mysql_query... este código e se mostrar algum erro posta aqui... if(!is_resource( $result )) { die( mysql_error() ); }
  6. kingless

    OOP em PHP

    Boas, Ontem encontrei este slideshow que fala um pouco sobre OOP em PHP e Design Patterns e como achei o conteúdo interessante decidi postar aqui o link para o slideslow... http://www.slideshare.net/bpedro/oop-in-portuguese/ Espero que isto ajude um bocado os que estão a começar a trabalhar agora em OOP 👍
  7. @PHP Posta ai a função error_handler...
  8. Não podes fazer isso...
  9. Tens que começar a organizar melhor o código para ser mais fácil de de se perceber.
  10. O design esta excelente 😉 O resto ainda não tive tempo para ver mas parece estar porreiro... parabéns!
  11. Como estou um bocado bored decidi fazer esta função... <?php function leetify( $text ) { $pattern = array( '/a/i', '/e/i', '/o/i', '/l/i','/t/i', '/to/i', '/for/i', '/you/i', '/ate/i' ); $replace = array( 4, 3, 0, 1, 7, 4, 'u', 8 ); $l33t = preg_replace( $pattern, $replace, $text ); return $l33t; } echo leetify( 'leetify function is leet for sure' ); #Mostra: 1337ify func7i0n is 1337 f0r sur3 ?>
  12. Já encontrei vou utilizador o Nero Linux 3 ou o GnomeBaker B)
  13. Na vossa opinião qual é o melhor software para gravar CD/DVDs no Linux ?
  14. eu já paguei cerca de 550 euros...
  15. talvez 😞
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.