Code |
Context $nb_matches = preg_match_all($pattern, $contenu, $matches);
$moitie = $nb_matches / 2;
$contenu = preg_replace('#' . preg_quote($matches[0][$moitie - 1]) . '#', '$0{{#if ACCES::estConnecte()}}{{#else}}{{#endif}}', $contenu, 1, $count);
$article = array(
"AsArticle" => array(
"id" => "6747",
"langue_id" => "1",
"type" => "article",
"journal_id" => "87",
"pur_web" => "1",
"categorie_id" => "13",
"thematique_id" => "227",
"hot_prehome" => "0",
"edito_article_1_id" => null,
"edito_article_1_timing" => null,
"edito_article_2_id" => null,
"edito_article_2_timing" => null,
"edito_article_3_id" => null,
"edito_article_3_timing" => null,
"edito_article_4_id" => null,
"edito_article_4_timing" => null,
"edito_article_5_id" => null,
"edito_article_5_timing" => null,
"payant" => "0",
"mail_thematique" => null,
"titre" => "VIDÉO - Soulager le mal de tête naturellement ",
"titre_mep_accueil" => "",
"titre_mep_carrousel" => "",
"chapeau" => "<p class="introduction couleur_4B0082"><span style="color: #000000;"><span class="style-scope yt-formatted-string">Quels sont les causes des céphalées et comment les soulager efficacement grâce à des méthodes simples et naturelles ? </span>David Tan est Life Coach et Ostéopathe DO - Kinésithérapeute DE formé à Paris. Il explore avec passion le perfectionnement personnel et l’art de guérir depuis 25 ans. Pour en savoir plus sur sa méthode des cinq piliers, <a href="https://lifeforcewithyou.com/decouvrir-methode-lifeforce-lm2-alternativesante/" target="_blank">cliquez ici. </a></span></p>
<p class="introduction couleur_4B0082"><span style="color: #000000;"><br /></span></p>",
"texte" => "<p><span style="color: #000000;">Source OMS citée dans la vidéo <a href="https://www.who.int/fr/news-room/fact-sheets/detail/headache-disorders" target="_blank">ici</a>. </span></p>
<p><span style="color: #000000;">[lireaussi:6313]<br /></span></p>",
"auteur" => "",
"auteur_id" => "255",
"url" => "",
"tarif" => "",
"petition_id" => "",
"petition_signatures" => "0",
"petition_url" => "",
"meta_url" => "video-soulager-le-mal-de-tete-naturellement",
"meta_description" => "",
"meta_keywords" => "",
"meta_title" => "",
"publier" => "1",
"visible_webservice" => "0",
"articles_lies" => "",
"carousel_accueil_ids" => "",
"hot_petition" => "0",
"date_debut_publication" => "2020-04-30 00:00:00",
"tec_id" => null,
"ordre_article" => null,
"liens_ids" => "",
"modifie_le" => "0000-00-00 00:00:00",
"created" => "2020-04-30 14:32:38",
"modified" => "2020-04-30 16:24:53",
"balise_script" => null
),
"AsJournal" => array(
"id" => "87",
"langue_id" => "1",
"numero" => "79",
"titre" => "Alternative n°79",
"couverture" => "upload/images/as79_une_w1.jpg",
"pdf" => "alternative_sante_n-79.pdf",
"categories_ids" => "11,2,4,3,8,1,9,13,15,7,5,14",
"date_debut_publication" => "2020-04-30 00:00:00",
"sommaire" => "",
"seo_title" => "",
"seo_description" => ""
),
"AsThematique" => array(
"id" => "227",
"parent_id" => "0",
"flag_form_inscription" => "0",
"ordre" => "0",
"dolist_id" => null,
"emarsys_id" => null,
"modified" => "2014-10-02",
"id_langue" => "1",
"titre" => "Migraine",
"article_lie_id" => null,
"id_multilangues" => "227"
),
"AsCategorie" => array(
"id" => "13",
"ordre" => "10",
"gabarit" => "mosaique_4",
"gabarit_recherche" => "multi_4",
"gabarit_tous" => "mosaique_4",
"couleur" => "#4B0082",
"liaisons_articles" => "0",
"url_video" => "",
"meta_title" => "Stages et thérapies",
"meta_description" => "Les annonces des praticiens et enseignants qui vous ouvrent les portes de la santé",
"titre_page" => "VIDEOS",
"noindex" => "1",
"menu" => "0",
"articles_en_avant" => "",
"id_langue" => "1",
"titre" => "Vidéos",
"id_multilangues" => "13"
),
"AsAuteur" => array(
"id" => "255",
"nom" => "David Tan",
"pseudo" => null,
"avatar" => null,
"script_article" => null,
"script_liste" => null
),
"Media" => array(
array()
),
"AsTag" => array(
array()
),
"AsArticlesLies" => array(
array(),
array()
)
)
$contenu = "<p><span style="color: #000000;">Source OMS citée dans la vidéo <a href="https://www.who.int/fr/news-room/fact-sheets/detail/headache-disorders" target="_blank">ici</a>. </span></p>
<p><span style="color: #000000;">[lireaussi:6313]<br /></span></p>"
$pattern = "#<p[^>]*>(.+)</p>#"
$matches = array(
array(
"<p><span style="color: #000000;">Source OMS citée dans la vidéo <a href="https://www.who.int/fr/news-room/fact-sheets/detail/headache-disorders" target="_blank">ici</a>. </span></p>",
"<p><span style="color: #000000;">[lireaussi:6313]<br /></span></p>"
),
array(
"<span style="color: #000000;">Source OMS citée dans la vidéo <a href="https://www.who.int/fr/news-room/fact-sheets/detail/headache-disorders" target="_blank">ici</a>. </span>",
"<span style="color: #000000;">[lireaussi:6313]<br /></span>"
)
)
$nb_matches = 2
$moitie = 1
$count = null
preg_replace - [internal]:??
ArticlesHelper::contenu_avec_pub() - CORE/plugins/plugin_as/views/helpers/articles.php:38
ArticlesHelper::contenu_article() - CORE/plugins/plugin_as/views/helpers/articles.php:8
include - APP/views/plugins/plugin_as/default/articles/article.ctp:265
View::_render() - CORE/cake/libs/view/view.php:766
View::render() - CORE/cake/libs/view/view.php:445
Controller::render() - CORE/cake/libs/controller/controller.php:909
AppController::render() - APP/app_controller.php:158
Dispatcher::_invoke() - CORE/cake/dispatcher.php:207
Dispatcher::dispatch() - CORE/cake/dispatcher.php:171
[main] - APP/webroot/index.php:87