<?php
foreach ($cont_url2 as $el2) {
$pq2 = pq($el2);
$text2 = $pq2->find('.messageText');
$text2->remove('[noindex]');
$text2->remove('.internalLink');
$text2->remove('.mceSmilie');
$text2->remove('.messageTextEndMarker');
$text2->remove('aside');
if(!empty($text2)) {
$post_prev = R::dispense('postprev');
$post_prev->text = $text2->html();
R::store($post_prev);
}
}
<?php
foreach ($cont_url2 as $el2) {
$pq2 = pq($el2);
$text2 = $pq2->find('.messageText');
$text2->remove('[noindex]');
$text2->remove('.internalLink');
$text2->remove('.mceSmilie');
$text2->remove('.messageTextEndMarker');
$text2->remove('aside');
if(!empty($text2)) {
$post_prev = R::dispense('postprev');
$post_prev->text = (string) $text2;
R::store($post_prev);
}
}
// set up plain http server
var http = express.createServer();
// set up a route to redirect http to https
http.get('*', function(req, res) {
res.redirect('https://' + req.headers.host + req.url);
// Or, if you don't want to automatically detect the domain name from the request header, you can hard code it:
// res.redirect('https://example.com' + req.url);
})
// have it listen on 8080
http.listen(8080);
str_replace($html, "\"", "'");
На странице выводятся несколько слов к примеру:
Нужен js код который заменял бы их на нужные предложения. Вот такие: