페이지 당 설명 및 키워드를 만드는 방법을 알아 내려고하고 있습니다.PHP 제목, 설명 및 키워드 페이지 당
타이틀은 다음과 같습니다에 대한 설명
{{title=some page title in here}}
, 나는 이런 식으로 뭔가 할 것 :
는 또한{{description=some description per page in here}}
키워드 메타 태그, 나는 같은 것을 할 것을 :
{{keywords=example keyword, per each page, this is an example}}
어떻게 preg_replace + regex 파싱을 사용하면 페이지에서 볼 수 없게 될까요? 그것은 자기 만 같은 실제 메타 정보에 배치 :
<title> some page title in here </title>
<meta name="description" content="some description per page in here">
<meta name="keywords" content="example keyword, per each page, this is an example">
페이지의 예는 다음과 같이 보일 것이다 :
{{title=some page title in here}}
{{description=some description per page in here}}
{{keywords=example keyword, per each page, this is an example}}
<div id="content">
<h4> Some page title here </h4>
<p> Some page paragraphs here. </p>
</div> <!--#content-->
물론 결과의
이에 시뮬 것 :<html>
<head>
<title> Website Title - some page title in here </title>
<meta name="description" content="some description per page in here">
<meta name="keywords" content="example keyword, per each page, this is an example">
</head>
<body>
<div id="content">
<h4> Some page title here </h4>
<p> Some page paragraphs here. </p>
</div> <!--#content-->
</body>
</html>
도움을 많이 주셔서 감사합니다. 페이지 제목은 이전 스크립트에 설정되어있는
<title><?php echo $page_title; ?></title>
이
이 더 나은 것 모든 남아있는 HTML을 가지고 이런 식의 솔루션 ... – Charlie
나는 당신의 목표를 잘 모르겠다. 정교하게 주시겠습니까? –
정규식은 {{제목 = 여기에 일부 페이지 제목}}이고 {{설명 = 페이지 당 몇 가지 설명은 여기}} 이고 {{keyword = 예제 키워드, 각 페이지마다 예}}}에서 이 구문 분석을 수행하십시오 – Tux