<div style="margin: 0px 0px 0px 15px; padding: 20px 0px; border-width: 1px 0px; border-top-style: solid; border-bottom-style: solid; border-top-color: rgb(170, 170, 170); border-bottom-color: rgb(170, 170, 170); width: 710px; color: rgb(0, 0, 0); font-family: Verdana, Arial, 宋体; font-size: 12px; line-height: normal; background-color: rgb(249, 249, 249);"> <h2 style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-family: 微软雅黑; font-size: 14px;">定义和用法</h2> <p style="margin: 12px 0px 0px; padding: 0px; border: 0px; line-height: 18px;">dirname() 函数返回路径中的目录部分。</p> <h3 style="margin: 20px 0px 0px; padding: 0px; border: 0px; font-weight: bold; font-size: 12px;">语法</h3> <pre style="margin-top: 10px; margin-bottom: 0px; padding: 10px; border: 1px dotted rgb(119, 136, 85); font-family: Consolas, 'Courier New', Courier, monospace; width: 685px; background: rgb(245, 245, 245);"> dirname(path)</pre> <table class="dataintable" style="margin: 10px 0px 0px; padding: 0px; border: 1px solid rgb(170, 170, 170); border-collapse: collapse; width: 709px;"> <tbody style="margin: 0px; padding: 0px; border: 0px;"> <tr style="margin: 0px; padding: 0px; border: 0px;"> <th style="margin: 0px; padding: 5px 15px 5px 6px; border: 1px solid rgb(170, 170, 170); vertical-align: baseline; background-color: rgb(213, 213, 213);">参数</th> <th style="margin: 0px; padding: 5px 15px 5px 6px; border: 1px solid rgb(170, 170, 170); vertical-align: baseline; background-color: rgb(213, 213, 213);">描述</th> </tr> <tr style="margin: 0px; padding: 0px; border: 0px;"> <td style="margin: 0px; padding: 6px 15px 6px 6px; border: 1px solid rgb(170, 170, 170); vertical-align: text-top; background-color: rgb(239, 239, 239);">path</td> <td style="margin: 0px; padding: 6px 15px 6px 6px; border: 1px solid rgb(170, 170, 170); vertical-align: text-top; background-color: rgb(239, 239, 239);">必需。规定要检查的路径。</td> </tr> </tbody> </table> <h3 style="margin: 20px 0px 0px; padding: 0px; border: 0px; font-weight: bold; font-size: 12px;">说明</h3> <p style="margin: 12px 0px 0px; padding: 0px; border: 0px; line-height: 18px;"><i style="margin: 0px; padding: 0px; border: 0px;">path</i>参数是一个包含有指向一个文件的全路径的字符串。该函数返回去掉文件名后的目录名。</p> </div> <div style="margin: 0px 0px 0px 15px; padding: 20px 0px; border-width: 1px 0px; border-top-style: solid; border-bottom-style: solid; border-top-color: rgb(170, 170, 170); border-bottom-color: rgb(170, 170, 170); width: 710px; color: rgb(0, 0, 0); font-family: Verdana, Arial, 宋体; font-size: 12px; line-height: normal; background-color: rgb(249, 249, 249);"> <h2 style="margin: 0px; padding: 0px; border: 0px; font-weight: bold; font-family: 微软雅黑; font-size: 14px;">例子</h2> <pre style="margin-top: 10px; margin-bottom: 0px; padding: 10px; border: 1px dotted rgb(119, 136, 85); font-family: Consolas, 'Courier New', Courier, monospace; width: 685px; background: rgb(245, 245, 245);"> &lt;?php echo dirname(&quot;c:/testweb/home.php&quot;); echo dirname(&quot;/testweb/home.php&quot;); ?&gt;</pre> <p style="margin: 12px 0px 0px; padding: 0px; border: 0px; line-height: 18px;">输出:</p> <pre style="margin-top: 10px; margin-bottom: 0px; padding: 10px; border: 1px dotted rgb(119, 136, 85); font-family: Consolas, 'Courier New', Courier, monospace; width: 685px; background: rgb(245, 245, 245);"> c:/testweb /testweb</pre> </div>
返回顶部 留言