[PHP]String 관련 함수 모음
개발관련/PHP 2012. 7. 19. 18:23 |1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | <script type= "text/javascript" > if (!window.T) { window.T = {} } window.T.config = { "TOP_SSL_URL" : "https://www.tistory.com" , "PREVIEW" :false, "ROLE" : "guest" , "PREV_PAGE" : "" , "NEXT_PAGE" : "" , "BLOG" :{ "id" :924257, "name" : "panocafe" , "title" : "파노카페" , "isDormancy" :false, "nickName" : "파노카페" , "status" : "open" , "profileStatus" : "normal" }, "NEED_COMMENT_LOGIN" :true, "COMMENT_LOGIN_CONFIRM_MESSAGE" : "이 블로그는 로그인한 사용자에게만 댓글 작성을 허용했습니다. 지금 로그인하시겠습니까?" , "LOGIN_URL" : "https://www.tistory.com/auth/login/?redirectUrl=https://panocafe.tistory.com/entry/PHPString-%25EA%25B4%2580%25EB%25A0%25A8-%25ED%2595%25A8%25EC%2588%2598-%25EB%25AA%25A8%25EC%259D%258C" , "DEFAULT_URL" : "https://panocafe.tistory.com" , "USER" :{ "name" :null, "homepage" :null, "id" :0, "profileImage" :null}, "SUBSCRIPTION" :{ "status" : "none" , "isConnected" :false, "isPending" :false, "isWait" :false, "isProcessing" :false, "isNone" :true}, "IS_LOGIN" :false, "HAS_BLOG" :false, "IS_SUPPORT" :false, "IS_SCRAPABLE" :false, "TOP_URL" : "http://www.tistory.com" , "JOIN_URL" : "https://www.tistory.com/member/join" , "PHASE" : "prod" , "ROLE_GROUP" : "visitor" }; window.T.entryInfo = { "entryId" :303, "isAuthor" :false, "categoryId" :339761, "categoryLabel" : "개발관련/PHP" }; window.appInfo = { "domain" : "tistory.com" , "topUrl" : "https://www.tistory.com" , "loginUrl" : "https://www.tistory.com/auth/login" , "logoutUrl" : "https://www.tistory.com/auth/logout" }; window.initData = {}; window.TistoryBlog = { basePath: "" , token: "0z1r9QafXtAkP1BIHEHga21I860ht87n5quC+m17IfnsU4sXlS0QEn6dsc8THFW6" }; var servicePath = "" ; var blogURL = "" ;</script> <title>String Functions</title> <style type= "text/css" >.another_category { border: 1px solid #E5E5E5; padding: 10px 10px 5px; margin: 10px 0; clear: both; } .another_category h4 { font-size: 12px !important; margin: 0 !important; border-bottom: 1px solid #E5E5E5 !important; padding: 2px 0 6px !important; } .another_category h4 a { font-weight: bold !important; } .another_category table { table-layout: fixed; border-collapse: collapse; width: 100% !important; margin-top: 10px !important; } * html .another_category table { width: auto !important; } *:first-child + html .another_category table { width: auto !important; } .another_category th, .another_category td { padding: 0 0 4px !important; } .another_category th { text-align: left; font-size: 12px !important; font-weight: normal; word- break : break -all; overflow: hidden; line-height: 1.5; } .another_category td { text-align: right; width: 80px; font-size: 11px; } .another_category th a { font-weight: normal; text-decoration: none; border: none !important; } .another_category th a.current { font-weight: bold; text-decoration: none !important; border-bottom: 1px solid !important; } .another_category th span { font-weight: normal; text-decoration: none; font: 10px Tahoma, Sans-serif; border: none !important; } .another_category_color_gray, .another_category_color_gray h4 { border-color: #E5E5E5 !important; } .another_category_color_gray * { color: #909090 !important; } .another_category_color_gray th a.current { border-color: #909090 !important; } .another_category_color_gray h4, .another_category_color_gray h4 a { color: #737373 !important; } .another_category_color_red, .another_category_color_red h4 { border-color: #F6D4D3 !important; } .another_category_color_red * { color: #E86869 !important; } .another_category_color_red th a.current { border-color: #E86869 !important; } .another_category_color_red h4, .another_category_color_red h4 a { color: #ED0908 !important; } .another_category_color_green, .another_category_color_green h4 { border-color: #CCE7C8 !important; } .another_category_color_green * { color: #64C05B !important; } .another_category_color_green th a.current { border-color: #64C05B !important; } .another_category_color_green h4, .another_category_color_green h4 a { color: #3EA731 !important; } .another_category_color_blue, .another_category_color_blue h4 { border-color: #C8DAF2 !important; } .another_category_color_blue * { color: #477FD6 !important; } .another_category_color_blue th a.current { border-color: #477FD6 !important; } .another_category_color_blue h4, .another_category_color_blue h4 a { color: #1960CA !important; } .another_category_color_violet, .another_category_color_violet h4 { border-color: #E1CEEC !important; } .another_category_color_violet * { color: #9D64C5 !important; } .another_category_color_violet th a.current { border-color: #9D64C5 !important; } .another_category_color_violet h4, .another_category_color_violet h4 a { color: #7E2CB5 !important; } </style> <link rel= "stylesheet" type= "text/css" href= "https://tistory1.daumcdn.net/tistory_admin/userblog/userblog-2f42fbf504a9342b3fd8297ed4953c4384cc5c1f/static/style/revenue.css" > <link rel= "canonical" href= "https://panocafe.tistory.com/entry/PHPString-%EA%B4%80%EB%A0%A8-%ED%95%A8%EC%88%98-%EB%AA%A8%EC%9D%8C" > <!-- BEGIN STRUCTURED_DATA --> <script type= "application/ld+json" > { "@context" : "http://schema.org" , "@type" : "BlogPosting" , "mainEntityOfPage" :{ "@id" : "https://panocafe.tistory.com/entry/PHPString-%EA%B4%80%EB%A0%A8-%ED%95%A8%EC%88%98-%EB%AA%A8%EC%9D%8C" , "name" :null}, "url" : "https://panocafe.tistory.com/entry/PHPString-%EA%B4%80%EB%A0%A8-%ED%95%A8%EC%88%98-%EB%AA%A8%EC%9D%8C" , "headline" : "[PHP]String 관련 함수 모음" , "description" : "Lowercase: Uppercase: Uppercase first-letter: Uppercase words: Length: Trim: Find: Replace by string: Repeat: Make substring: Find Position: Find Character:" , "author" :{ "@type" : "Person" , "name" : "파노카페" , "logo" :null}, "image" :{ "@type" : "ImageObject" , "url" : "https://img1.daumcdn.net/thumb/R800x0/?scode=mtistory2&fname=https%3A%2F%2Ft1.daumcdn.net%2Ftistory_admin%2Fstatic%2Fimages%2FopenGraph%2Fopengraph.png" , "width" : "800px" , "height" : "800px" }, "datePublished" : "2012-07-19T18:23:10+09:00" , "dateModified" : "2012-07-19T18:23:10+09:00" , "publisher" :{ "@type" : "Organization" , "name" : "TISTORY" , "logo" :{ "@type" : "ImageObject" , "url" : "https://t1.daumcdn.net/tistory_admin/static/images/openGraph/opengraph.png" , "width" : "800px" , "height" : "800px" }}} </script> <!-- END STRUCTURED_DATA --> <link rel= "stylesheet" type= "text/css" href= "https://tistory1.daumcdn.net/tistory_admin/userblog/userblog-2f42fbf504a9342b3fd8297ed4953c4384cc5c1f/static/style/dialog.css" > <link rel= "stylesheet" type= "text/css" href= "//t1.daumcdn.net/tistory_admin/www/style/top/font.css" > <link rel= "stylesheet" type= "text/css" href= "https://tistory1.daumcdn.net/tistory_admin/userblog/userblog-2f42fbf504a9342b3fd8297ed4953c4384cc5c1f/static/style/postBtn.css" > <link rel= "stylesheet" type= "text/css" href= "https://tistory1.daumcdn.net/tistory_admin/userblog/userblog-2f42fbf504a9342b3fd8297ed4953c4384cc5c1f/static/style/tistory.css" > <script type= "text/javascript" src= "https://tistory1.daumcdn.net/tistory_admin/userblog/userblog-2f42fbf504a9342b3fd8297ed4953c4384cc5c1f/static/script/common.js" ></script> <!--?php $firstString = "The quick brown fox" ; $secondString = " jumped over the lazy dog." ; ?--> <!--?php // Concatentation $thirdString = $firstString ; $thirdString .= $secondString ; echo $thirdString ; ?--> <br> Lowercase: <!--?php echo strtolower ( $thirdString ); ?--><br> Uppercase: <!--?php echo strtoupper ( $thirdString ); ?--><br> Uppercase first-letter: <!--?php echo ucfirst( $thirdString ); ?--><br> Uppercase words: <!--?php echo ucwords( $thirdString ); ?--><br> <br> Length: <!--?php echo strlen ( $thirdString ); ?--><br> Trim: <!--?php echo $fourthString = $firstString . trim( $secondString ); ?--><br> Find: <!--?php echo strstr ( $thirdString , "brown" ); ?--><br> Replace by string: <!--?php echo str_replace ( "quick" , "super-fast" , $thirdString ); ?--><br> <br> Repeat: <!--?php echo str_repeat ( $thirdString , 2); ?--><br> Make substring: <!--?php echo substr ( $thirdString , 5, 10); ?--><br> Find Position: <!--?php echo strpos ( $thirdString , "brown" ); ?--><br> Find Character: <!--?php echo strchr ( $thirdString , "z" ); ?--><br> <div style= "margin:0; padding:0; border:none; background:none; float:none; clear:none; z-index:0" ></div> <script type= "text/javascript" src= "https://tistory1.daumcdn.net/tistory_admin/userblog/userblog-2f42fbf504a9342b3fd8297ed4953c4384cc5c1f/static/script/common.js" ></script> <script type= "text/javascript" >window.roosevelt_params_queue = window.roosevelt_params_queue || [{channel_id: 'dk' , channel_label: '{tistory}' }]</script> <script type= "text/javascript" src= "//t1.daumcdn.net/midas/rt/dk_bt/roosevelt_dk_bt.js" async= "async" ></script> <script>window.tiara = { "svcDomain" : "user.tistory.com" , "section" : "글뷰" , "trackPage" : "글뷰_보기" , "page" : "글뷰" , "key" : "924257-303" , "customProps" :{ "userId" : "0" , "blogId" : "924257" , "entryId" : "303" , "role" : "guest" , "trackPage" : "글뷰_보기" , "filterTarget" :false}, "entry" :{ "entryId" : "303" , "entryTitle" : "[PHP]String 관련 함수 모음" , "entryType" : "POST" , "categoryName" : "개발관련/PHP" , "categoryId" : "339761" , "serviceCategoryName" :null, "serviceCategoryId" :null, "author" : "164388" , "authorNickname" : "파노카페" , "blogNmae" : "파노카페" , "image" : "" , "plink" : "/entry/PHPString-%EA%B4%80%EB%A0%A8-%ED%95%A8%EC%88%98-%EB%AA%A8%EC%9D%8C" , "tags" :[]}, "kakaoAppKey" : "3e6ddd834b023f24221217e370daed18" , "appUserId" : "null" }</script> <script type= "module" src= "https://t1.daumcdn.net/tistory_admin/frontend/tiara/v1.0.5/index.js" ></script> <script src= "https://t1.daumcdn.net/tistory_admin/frontend/tiara/v1.0.5/polyfills-legacy.js" nomodule= "true" defer= "true" ></script> <script src= "https://t1.daumcdn.net/tistory_admin/frontend/tiara/v1.0.5/index-legacy.js" nomodule= "true" defer= "true" ></script> |
'개발관련 > PHP' 카테고리의 다른 글
[Lynda.com]PHP with MySQL Beyond the Basics (0) | 2012.07.31 |
---|---|
[Lynda.com]PHP with MySQL Essential Training (0) | 2012.07.31 |
[PHP]로그아웃 단계 (0) | 2012.07.18 |
[PHP]텍스트 인코딩 & 변환 (0) | 2012.07.18 |
[PHP]DB Insert 전 Query문 정화(?) 함수 (0) | 2012.07.18 |