简体   繁体   中英

Comparing uuids for equality (in php)

What is the right way to check for equality of 2 uuids in PHP? I need to check 2 variables which have uuid values and act upon the result. I tried strcmp() but that did not yield the right value.

Thanks! mmiz

strcmp() works fine for comparing strings. If you claim otherwise, you would need to provide a self contained fully running code sample to prove it. My point is, you've made a mistake elsewhere.

Personally, I would just use the strict (===) comparison operator though

if ($a === $b)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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