djthyrax Posted November 29, 2006 at 11:02 AM Report #67538 Posted November 29, 2006 at 11:02 AM Uma função para tirar a quote nr tal ou uma random. function bash_get($arg){ if(empty($arg)) $file=file_get_contents("http://bash.org/?random"); else{ if(is_numeric($arg)) $file=file_get_contents("http://bash.org/?".$arg); else return "bash.org: Invalid quote id."; } $file=str_replace(' ', '', $file); preg_match("/<p class=\"qt\">(.*)<\/p>/", $file, $quote); $quote=$quote['1']; preg_match("/<a href=\"\?(.*)\" title=\"Permanent link to this quote\.\">/", $file, $id); $id=$id['1']; if(!$quote) return "bash.org quote not found."; else return "bash.org quote #<b>$id:</b><br />$quote"; } ? Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now