Maison >développement back-end >tutoriel php >php 成员变量赋值用连接符报错
<code><span><span>class</span><span>FileUploadController</span><span>extends</span><span>Controller</span>{</span><span>private</span><span>$path</span> = BASEDIR.<span>"/Public/Upload"</span>; <span>//<strong>上传文件</strong>保存你路径</span><span>private</span><span>$allowType</span> = <span>array</span>(<span>'jpg'</span>,<span>'png'</span>,<span>'gif'</span>); <span>//文件限制格式</span></code>
<code><span>public</span><span><span>function</span><span>__construct</span><span>()</span>{</span><span>$this</span>->path = <span>__DIR__</span>.<span>"/Public/Upload"</span>; }</code>
以上就介绍了php 成员变量赋值用连接符报错,包括了上传文件方面的内容,希望对PHP教程有兴趣的朋友有所帮助。