php - user id which initiated script -
i'm developing website on wordpress platform. have strange issues caused user id. user initiated script:
global $user_id;
what mean is, when go page, , php executes, need know user id in php when code executes. reasons, sometime id not right.
also when php script executing , if do:
global $user_id = get_current_user_id();
then have user id initiated script ?
the issue in strpos(), not smart function, not able find substring:
strpos($text,'{"user":"'.$user_id.'","status":"2"}');
but substr_count() worked. , not first time when strpos() fault... no more use it.
Comments
Post a Comment