str_replace 질문좀 드리겠습니다. 정보
str_replace 질문좀 드리겠습니다.본문
그누보드와 관련 없는 질문이라 죄송합니다.
php 질문과 답변을 받을 수 있는곳이 여러모로 부족한거 같네요.
제가 테터툴즈(텍스트큐브)의 치환자 시스템(?)에 반해버린것 같습니다.
아직 미흡한 실력이지만 겉모습이라도 따라해 보려고 str_replace를 요리 조리 굴리고 있는데...
먼저 /replacement/rep_index.php 속 내용은 아래와 같습니다.
<?php
$tmp_content = str_replace("[##_Title_##]", $paramValue['title'], $tmp_content);
?>
그리고 index.php 속 내용은 아래와 같습니다.
<?php
switch($mod) {
case "index" : {
$tmp_content = include("./replacement/rep_index.php");
$tmp_content = file_get_contents("./templeat/index.html");
} break;
}
echo $tmp_content;
?>
아... 하이라이트 입히기 귀찮네요 =ㅅ=...
위와 같은식으로 한 뒤 index.php?mod=index 로 접속을 하면
templeat/index.html가 보이긴 하나 /replacement/rep_index.php 에서 치환한
##_Title_## 이 그대로 <title></title> 안에 치환되지 않고 표시 됩니다.
근데, index.php 소스에 바로 str_replace 를 넣어서 치환을 하면 제대로 표시가 됩니다.
왜 이런 현상이 일어나나요? 그리고 이런식으로 하면 사이트에 속도적인 문제가 있을까요 ?
*** 개인정보보호를 위한 이메일주소 노출방지 *** 으로 답변을 주시거나 덧글로 부탁드리겠습니다...
추천
0
0
댓글 4개
질문과 관계없는 오타발견~!!
templeat
templeat
아...안돼!! 몬지터링 하고 있었는데...ㅠㅠㅠㅠㅠ
$tmp_content = include("./replacement/rep_index.php");
$tmp_content = file_get_contents("./templeat/index.html");
-->
$tmp_content = file_get_contents("./templeat/index.html");
include("./replacement/rep_index.php");
$tmp_content = file_get_contents("./templeat/index.html");
-->
$tmp_content = file_get_contents("./templeat/index.html");
include("./replacement/rep_index.php");
군포돼지님 감사합니다...ㅠㅠ...