Skip to content
Gnitfos 2009 home!
http://fais.kr/xe/
글수
11
회원 가입
로그인
해당 변수에서 줄바꿈하는 부분 삭제하는 소스 [자바스크립트 적용시 사용됨]
지에프
http://fais.kr/xe/1349
2010.05.04
17:13:15
3122
피에이치피
자바스크립트에 php변수를 출력시 엔터가 있으면 자바스크립트는 에러를 표시한다.
아래와 같이 사용하면 된다.
<?=str_replace(chr(13).chr(10),'',줄바꿈을없애야하는 변수)?>
chr(13) : \r carriage return
chr(10): \n NL line feed, new line
이상하게 '\r\n'을 하면 없다고 한다.
nl2br, str_replace 다사용해보았지만 줄바꿈이 사라지지 않았다.
이 게시물을..
목록
엮인글 주소 : http://fais.kr/xe/1349/df2/trackback
번호
분류
자바스크립트 (17)
피에이치피 (11)
마이 에스큐엘 (7)
작업 (1)
기타 (32)
아작스 (3)
글쓴이
날짜
조회수
공지
FAQ > 이지보드와 미니홈피에도 있음
44
지에프
2009-04-21
39673
11
피에이치피
세션 실행시설정 항목에 대한 설명 (봐도 이해는 잘안됨.ㅋ) -
이 함수의 작동은 php.ini 설정에 영향을 받습니다. 세션 설정 옵션 이름 기본값 변경권한 변경 기록 session.save_path "" PHP_INI_ALL session.name "PHPSESSID" PHP_INI_ALL session.save_handler- "files" PHP_INI_ALL session.auto_start "0" PHP_INI_ALL session.gc_probabili-ty "1" PHP_INI_ALL session.gc_divisor "100" PHP_INI_ALL PHP 4.3.2부터 사용 가능. session.gc_maxlifeti-me "1440" PHP_INI_ALL session.serialize_ha-ndler "php" PHP_INI_ALL session.cookie_lifet-ime "0" PHP_INI_ALL session.cookie_path "/" PHP_INI_ALL session.cookie_domai-n "" PHP_INI_A...
2
44
지에프
2010-11-17
6734
10
피에이치피
자바스크립트 변수에 넣을때 문제되는 줄바꿈 없애기 -
자바스크립트에선 변수를 정의 할때 줄바꿈을 하게 되면 에러가 생긴다.$p_content2 = preg_replace(array('/\r/','/\n/'),'',$p_content1);
2
47
지에프
2010-11-10
7005
9
피에이치피
php에서 큰따옴표(")와 작은 따옴표(')의 차이 -
PHP 에서, 큰따옴표(쌍따옴표:")와 작은따옴표(홑따옴표:')는 사용법이 다릅니다. 큰 따옴표 속의 특수문자들은 그 의미에 따라 다른 값으로 치환됩니다. 그러나 작은따옴표 속의 문자열은 "문자 그대로"로 인식됩니다.
2
46
지에프
2010-11-10
6154
8
피에이치피
사용자에게 경로를 숨기고 파일 다운 받게 하기 -
<?php header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename="down.pdf"'); readfile("읽어들일 경로와 파일명"); ?> Content-type 종류 Type application: Multipurpose files application/EDI-X12: EDI X12 data; Defined in RFC 1767 application/EDIFACT: EDI EDIFACT data; Defined in RFC 1767 application/json: JavaScript Object Notation JSON; Defined in RFC 4627 application/javascri-pt: JavaScript; Defined in RFC 4329 but not accepted in IE 8 or earlier application/octet-stre...
2
28
지에프
2010-10-20
5055
7
피에이치피
변수에 여러줄로 된 값을 정의하는 방법 -
Strings - Heredoc A third way to delimit strings is the heredoc syntax: <<<. After this operator, an identifier is provided, then a newline. The string itself follows, and then the same identifier again to close the quotation. The closing identifier must begin in the first column of the line. Also, the identifier must follow the same naming rules as any other label in PHP: it must contain only alphanumeric characters and underscores, and must start with a non-digit character or underscor...
1
792
지에프
2010-10-13
52667
피에이치피
해당 변수에서 줄바꿈하는 부분 삭제하는 소스 [자바스크립트 적용시 사용됨] -
자바스크립트에 php변수를 출력시 엔터가 있으면 자바스크립트는 에러를 표시한다.아래와 같이 사용하면 된다.<?=str_replace(chr(13).-chr(10),'',줄바꿈을없애야하는 변수)?>chr(13) : \r carriage return chr(10): \n NL line feed, new line이상하게 '\r\n'을 하면 없다고 한다.nl2br, str_replace 다사용해보았지만 줄바꿈이 사라지지 않았다.
지에프
2010-05-04
3123
5
피에이치피
C의 역슬래시 코드들 -
(\b: 백스페이스) - 말 그대로 문자 하나를 printf함수로 뽑아낼 글자뒤에 붙혀 없애준다. (\f: 폼피드) - 특수문자 " 여자표시(거울)" 을 나타낸다. (\n: 뉴라인) - 문서작업유틸에서 엔터쳐서 다음줄로 넘어가지게 해준다. (\r: 캐리지 리턴) - 다음 글자가 찍힐 위치를 그 줄의 왼쪽 끝으로 돌려보낸다. (\t: 수평탭) - 탭(tab)키를 누른 것과 같은 효과를 나타낸다. (\": 큰 따옴표) - 글자에 큰 따옴표가 보이도록 한다. (\': 작은 따옴표) - 글자에 작은 따옴표가 보이도록 한다. (\o: 널(null)) - 무의미함 (\\: 역슬래쉬) - 문자함수 (\v: 수직탭) - 특수문자 ...
지에프
2010-05-04
6717
4
피에이치피
몇일후 날짜 계산 -
$t_date1 = mktime(0,0,0,date("m"), date("d")+7, date("Y")); // 7일후
1
2
asdf
2010-02-10
22683
3
피에이치피
배열내 중복된 value 지우는 array_unique()함수 -
inputarray(7) { [0]=> string(1) "2" [1]=> string(2) "35" [2]=> string(2) "42" [3]=> string(4) "100 " [4]=> string(1) "2" [5]=> string(1) "3" [6]=> string(3) "100"}////////////////////-///////////처리////////////////////-////////////////////-//for($i=0; $i<sizeof($a); $i++){ $a[$i] = (int)$a[$i]; }$a = array_unique($a);asort ($a);////////////////////-////////////////////-////////////////////-////////////////////-outputarray(5) { [0]=> int(2) [5]=> int(3) [1]=> int(35) [2]=> int(42) [3]=> int(100)}
2
지에프
2009-06-16
24438
2
피에이치피
php에선 같은 문자열이라도 string(5), string(2)이렇게 사이즈가 다르면 다른것이다. -
$a - string(2) "2"$a - string(5) "2"($a == $b) => false( (int) $a == (int) $b) => true
1
지에프
2009-06-16
7257
1
피에이치피
회원 가입시 입력하는 자동가입방지 문자열 이미지 만들기 -
<? // 회원 가입시 입력하는 자동가입방지 문자열 이미지 만들기 function randText($strSize) { $str = ""; for ($i=0; $i<$strSize; $i++) { $num = rand() % 52; if ($num < 26) $str .= chr($num + 65); // 대문자 else $str .= chr($num + 97 - 26); //소문자 출력 } return $str; } $fontname = "./malgun.ttf"; // php 파일과 같은 디렉토리거나, 경로까지 설정해야함 $width = "500"; $height = "500"; function euckr2utf8($text) { return stripslashes(iconv("EUC-KR","UTF-8",$text)); } $text = randTe...
지에프
2009-05-13
5252
목록
쓰기
첫페이지
1
끝페이지
제목
내용
제목+내용
댓글
이름
닉네임
아이디
태그
검색
취소
home
Biblical Expressions
FAQ
링크
아이디 :
비밀번호 :
로그인 유지
회원 가입
아이디/비밀번호 찾기
회원:
1
새글:
0
등록일:
2009.04.01
오늘 :
1,186
어제 :
1,571
전체 :
746,564
지에프
지에프
774
지에프
7
Powered by
XE
.
Language:한국어
English
中文(中国)
日本語
Español
Русский
Français
中文(臺灣)