Search the Community
Showing results for tags 'php 7'.
Found 2 results
-
Pessoal, tenho uma aplicação que funcionava há muitos anos sem problemas, mas percebi que o meu servidor atualizou o PHP 5 para PHP 7 sem me comunicar. Tenho uma função que contém alguns arrays e essa função parou de funcionar após a atualização. Gostaria saber se esse conjunto de arrays funciona dessa forma no PHP 7: $msg = array ( 'title' => 'Novo pedido', 'body' => $endereco, 'sound' => 'default' ); $fields = array ( 'to' => $tokenempresa, 'notification' => $msg ); $headers = array ( 'Authorization: key=' . API_ACCESS_KEY, 'Content-Type: application/json' ); Não entendo muito de PHP e não sei se esse código está correto.
-
Tou com um erro no meu script e não sei identificar erra pra ele exibir a imagem do usuário mas isso não está acontecendo Error: funcao.php: function ver_avatar($nick){ include 'str_get_html.php'; $url = "http://pt.clubcooee.com/users/view/".$nick; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); curl_setopt($ch, CURLOPT_TIMEOUT, 15); $return = curl_exec($ch); curl_close($ch); $html = str_get_html($return); $res = $html->find('.m33 img'); $imgLink = $res[0]->attr['src']; return $imgLink; } str_get_html.php: <?php function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) { $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); if (empty($str) || strlen($str) > MAX_FILE_SIZE) { $dom->clear(); return false; } $dom->load($str, $lowercase, $stripRN); return $dom; } ?> menu.php: <div class="usr-nav"> <img src="<?php $veavt = ver_avatar($usr); echo $veavt; ?>" class="img-usr"> <p class="name-usr">Nome do Usuário</p> </div> Me Ajudem mas rápido possível pfvrrrr
- 1 reply
-
- str_get_html
- php
-
(and 6 more)
Tagged with: