简体   繁体   English

如何在单个语句中组合多个php函数?

[英]How to combine multiple php functions in single statement?

What am trying to do is to get the JPG file location from the below function. 试图做的是从以下功能获取JPG文件的位置。

Whenever I try to execute this it throws the error "file not found", is there a syntax problem? 每当我尝试执行此操作时,它都会引发错误“找不到文件”,是否存在语法问题? If so, what should be the syntax to integrate multiple functions like this be? 如果是这样,集成这样的多个功能的语法应该是什么?

$handle = imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'/cts/'.$tempDir.'.jpg'); 

Try this: 尝试这个:

$handle = imagecreatefromjpeg($_SERVER['HTTP_HOST'].'/cts/'.$tempDir.'.jpg'); 

Or this: 或这个:

$handle = imagecreatefromjpeg('cts/'.$tempDir.'.jpg'); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM