Chỉnh sửa: Tôi không nhận ra họ muốn kiểm tra cụ thể liệu một đối tượng SimplexMlelement có trống không. Tôi đã để lại câu trả lời cũ bên dưới: I didn't realize they wanted to specifically check if a SimpleXMLElement object is empty. I left the old answer below
Trả lời cập nhật [SimplexMlelement]::
Đối với SimplexMlelement:
Nếu trống, bạn có nghĩa là không có thuộc tính:
$obj = simplexml_load_file[$url];
if [ !$obj->count[] ]
{
// no properties
}
HOẶC
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
Nếu SimplexMlelement là một cấp độ sâu và bằng cách trống, bạn thực sự có nghĩa là nó chỉ có thuộc tính PHP xem xét FALSEY [hoặc không có thuộc tính]:
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
Nếu SimplexMlelement sâu hơn một cấp, bạn có thể bắt đầu bằng cách chuyển đổi nó thành một mảng thuần túy:
$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
Câu trả lời cũ [đối tượng đơn giản]::
Nếu bạn muốn kiểm tra xem một đối tượng đơn giản [loại stdClass
] hoàn toàn trống [không có khóa/giá trị], bạn có thể làm như sau:
// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
Nguồn: //php.net/manual/en/language.oop5.Object-comparison.php
Chỉnh sửa: Đã thêm ví dụ: added example
$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
[Php 4, Php 5, Php 7, Php 8]
trống - xác định xem một biến có trống không — Determine whether a variable is empty
Sự mô tả
trống rỗng [hỗn hợp $var
]: bool[mixed $var
]: bool
Thông số
var
Biến cần được kiểm tra
Không có cảnh báo nào được tạo ra nếu biến không tồn tại. Điều đó có nghĩa là trống [] về cơ bản là tương đương ngắn gọn với! ISSET [$ var] || $ var == Sai.empty[] is essentially the concise equivalent to !isset[$var] || $var == false.
Trả về giá trị
Trả về
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
0 Nếu var
không tồn tại hoặc có giá trị trống hoặc bằng 0, hay còn gọi là Fisey, xem chuyển đổi sang Boolean. Nếu không thì trả về $obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
2.$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
0 if var
does not exist or has a value that is empty or
equal to zero, aka falsey, see conversion to boolean. Otherwise returns $obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
2. Ví dụ
Ví dụ #1 Một so sánh đơn giản trống [] / isset [].empty[] / isset[] comparison.
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
3Ví dụ #2 trống [] trên chuỗi offsetsempty[] on String Offsets
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
4Ví dụ trên sẽ xuất ra:
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]
Ghi chú
Lưu ý: Bởi vì đây là một cấu trúc ngôn ngữ và không phải là một hàm, nó không thể được gọi là sử dụng các hàm biến hoặc các đối số được đặt tên.: Because this is a language construct and not a function, it cannot be called using variable functions, or named arguments.
Ghi chú::
Khi sử dụng trống [] trên các thuộc tính đối tượng không thể truy cập, phương thức quá tải __isset [] sẽ được gọi, nếu được khai báo.empty[] on inaccessible object properties, the __isset[] overloading method will be called, if declared.
Xem thêm
- ISSET [] - Xác định xem một biến được khai báo và khác với NULL
- __isset[]
- unset [] - Und đặt một biến đã cho
- Array_Key_Exists [] - Kiểm tra xem khóa hoặc chỉ mục đã cho có tồn tại trong mảng
- Count [] - Đếm tất cả các phần tử trong một mảng hoặc trong một đối tượng có thể đếm được
- strlen [] - Nhận độ dài chuỗi
- Các bảng so sánh loại
Nanhe Kumar ¶ ¶
8 năm trước
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
5$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
6$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
7$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
8Janci ¶ ¶
13 năm trước
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
9$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
0$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
1$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Steven tại Nevvix Dot Com ¶ ¶
11 năm trước
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
3$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
4$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Thông tin tại Ensostudio Dot Ru ¶ ¶
1 năm trước
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
6Markmanning tại Gmail Dot Com ¶ ¶
3 năm trước
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
7$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
8$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
9$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
0anh em chấm của bạn dot t tại hotmail dot com ¶
7 năm trước
$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
1$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
2$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
3Martin Dot Aarhof tại Gmail Dot Com ¶ ¶
10 năm trước
$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
4$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
5$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Ẩn danh ¶ ¶
14 năm trước
$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
7$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
8$obj = simplexml_load_file[$url];
// `json_decode[json_encode[$obj], TRUE]` can be slow because
// you're converting to and from a JSON string.
// I don't know another simple way to do a deep conversion from object to array
$array = json_decode[json_encode[$obj], TRUE];
if [ !array_filter[$array] ]
{
// empty or all properties falsey
}
9// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
0$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Chrisdmiddleton tại Gmail Dot Com ¶ ¶
8 năm trước
// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
2// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
3// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
4Janci ¶ ¶
13 năm trước
// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
5Steven tại Nevvix Dot Com ¶ ¶
13 năm trước
// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
6Steven tại Nevvix Dot Com ¶ ¶
11 năm trước
// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
7Thông tin tại Ensostudio Dot Ru ¶ ¶
13 năm trước
// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
8// $obj is type stdClass and we want to check if it's empty
if [ $obj == new stdClass[] ]
{
echo "Object is empty"; // JSON: {}
}
else
{
echo "Object has properties";
}
9$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
0$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
1Steven tại Nevvix Dot Com ¶ ¶
14 năm trước
$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
2$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
3$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Chrisdmiddleton tại Gmail Dot Com ¶ ¶
wranvaud tại gmail dot com ¶
$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
55 năm trước ¶
11 năm trước
$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
6$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
7$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
8$one = new stdClass[];
$two = [object]array[];
var_dump[$one == new stdClass[]]; // TRUE
var_dump[$two == new stdClass[]]; // TRUE
var_dump[$one == $two]; // TRUE
$two->test = TRUE;
var_dump[$two == new stdClass[]]; // FALSE
var_dump[$one == $two]; // FALSE
$two->test = FALSE;
var_dump[$one == $two]; // FALSE
$two->test = NULL;
var_dump[$one == $two]; // FALSE
$two->test = TRUE;
$one->test = TRUE;
var_dump[$one == $two]; // TRUE
unset[$one->test, $two->test];
var_dump[$one == $two]; // TRUE
9$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Thông tin tại Ensostudio Dot Ru ¶ ¶
wranvaud tại gmail dot com ¶
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]1
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]2
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]3
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
25 năm trước ¶
13 năm trước
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]5
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]6
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Steven tại Nevvix Dot Com ¶ ¶
wranvaud tại gmail dot com ¶
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]8
bool[true] bool[false] bool[false] bool[false] bool[true] bool[true]9
stdClass
0
stdClass
1
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
25 năm trước ¶
Claudio Galdiolo ¶
stdClass
3
stdClass
4
stdClass
5
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2phpsort ¶ ¶
Denobocation-bozic et yahoo.com
stdClass
7
stdClass
8
stdClass
9
$var
0
$var
1
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Tom tại Tomwardrop Dot Com ¶ ¶
13 năm trước
$var
3
$var
4
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Steven tại Nevvix Dot Com ¶ ¶
wranvaud tại gmail dot com ¶
$var
6
$var
7
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
25 năm trước ¶
3 năm trước
$var
9
anh em chấm của bạn dot t tại hotmail dot com ¶
14 năm trước
var
0
var
1
var
2
var
3
$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Chrisdmiddleton tại Gmail Dot Com ¶ ¶
wranvaud tại gmail dot com ¶
var
5
5 năm trước ¶
Claudio Galdiolo ¶
var
6
var
7
var
8
var
9
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
00$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2phpsort ¶ ¶
wranvaud tại gmail dot com ¶
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
02$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
03$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
25 năm trước ¶
10 năm trước
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
05$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
06$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Ẩn danh ¶ ¶
wranvaud tại gmail dot com ¶
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
08$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
09$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
10$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
11$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
12$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
13$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
25 năm trước ¶
Claudio Galdiolo ¶
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
15$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
7$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
17phpsort ¶ ¶
Denobocation-bozic et yahoo.com
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
18$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
19$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
20$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Tom tại Tomwardrop Dot Com ¶ ¶
Denobocation-bozic et yahoo.com
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
22$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
23$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
24$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
25$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
26Tom tại Tomwardrop Dot Com ¶ ¶
13 năm trước
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
27$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
28$obj = simplexml_load_file[$url];
if [ !array_filter[[array]$obj] ]
{
// all properties falsey or no properties at all
}
2Steven tại Nevvix Dot Com ¶ ¶
Denobocation-bozic et yahoo.com
$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
30$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
31$obj = simplexml_load_file[$url];
if [ ![array]$obj ]
{
// empty array
}
32