为什么我在使用函数getimagesize
php?
这是我的代码test.php
,用于将数据更新到mysql中。
<?PHP
include("connect.php");
?>
<form class="form" method="post" action="" ENCTYPE = "multipart/form-data">
<textarea id="editor" name="editor">
</textarea>
<input type="submit" name="submit" value="OK">
</form>
<?PHP
if(isset($_POST["submit"]))
{
$editor = $_POST['editor'];
preg_match_all('/< *img[^>]*src *= *["\']?([^"\']*)/i', $editor, $image_article);
$og_image_video_length = count($image_article[0]);
for($i_og_image_video=0;$i_og_image_video<$og_image_video_length;$i_og_image_video++)
{
$og_image_video_temp = $image_article[1][$i_og_image_video];
$og_image_video_dimension = getimagesize($og_image_video_temp);
}
$db_mysqli->query("Update test_1 Set xxx = '$editor' Where id = '170'");
}
?>
对于测试,我的代码必须将此数据粘贴到textarea
<p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25446441_1413986165396057_7730258373599423649_n.jpg?oh=7dd78be017547338429061b5868732a9&oe=5AB769F6" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25395840_1413986205396053_7023894077762247342_n.jpg?oh=355cfdc72a8be04e7a8faf320738780c&oe=5AB4061B" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25354046_1413986228729384_9088440758302530916_n.jpg?oh=4c4bff19766cc26c6bc44dc0ee80593f&oe=5AC8683C" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25399057_1413986272062713_4885847107829951044_n.jpg?oh=52d769a4812bf0cbf2d068095e5f7c8e&oe=5AB875F1" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/24991265_1413986312062709_6468604703993578183_n.jpg?oh=96809eaceb433029db568b55f1aabc76&oe=5ACD2A84" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25443220_1413986365396037_3000883131483917887_n.jpg?oh=128427322f0167b631585d2876d40056&oe=5AFD7103" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25395804_1413986418729365_2494327754410292166_n.jpg?oh=50816bc486e3bbfcc5481fb843da6b62&oe=5AB4771A" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25396114_1413986455396028_7613670411230571813_n.jpg?oh=3435fa15c4b53e8ac393135b61aa3c4c&oe=5AFE8856" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25498256_1413986482062692_3071425741853380360_n.jpg?oh=09dad424b5b98fa53b322030370d83ab&oe=5AF69C6A" alt=""><br></p><p style="text-align: center;"><img src="https://scontent.fbkk5-3.fna.fbcdn.net/v/t1.0-9/25354096_1413986518729355_6808451190074179510_n.jpg?oh=d4d15fbbc0869aead0365f1145b69249&oe=5AFA907A" alt=""><br></p>
按下按钮时。它不会将数据更新为mysql。
但是当我从test.php
$og_image_video_dimension = getimagesize($og_image_video_temp);
它会将数据更新为mysql成功。
我想知道为什么在使用函数getimagesize
php时无法将数据更新到mysql中?