I currently have the date time in this format:
2015-07-05T09:50:38.0870000Z
How can I convert this into
2015-07-05 09:50:38, such that I can import this into mysql database?
Hi All,
Thanks for your support on this. I can confirm the issue is to do with me sending many http request on average it will take 1s for me to send and read a http request.
I am currently using curl and need to because I am adding a key which allows me to use the api. I am unable to insert the key thus unable to compare speeds with file_get_content.
Currently working on a cache system for the data.
Cant use in_array since this does not work on multi dimensional arrays.
I found the reason for my code taking a while. For each image I want to display and am sending one http request. So If I want to get 9 images I send 9 http requests.
Hard to say if this is directly related to my internet connection or code. will try to test on another network and compare the speeds
Sorry I don't understand this fully.
This if statement will always be true. As every game has a Box Art image with height of 300.
Since the 2nd loop is indented and I have begun the loop I don't think I am overwriting $xbox360Games.
I have now changed this variable in the 2nd loop as I am confusing myself now .
Also, Please can some help me with the sleep of this algorithm as I am still experiencing upto 9 seconds for each cycle in the 2nd loop.
Thanks
So I am currently using: https://xboxapi.com/
My aim to get the game image image of a users played game.
foreach($xbox360Games['titles'] as $val) { //This Loop gets all xbox360 games from a userid
if ($val['currentGamerscore'] > 0 ){ //this rules out non game appes iplayer,twitch etc
$xbox360Games = getGameInfo(dechex($val['titleId']));
//GetGameInfo is a fuction which will return the array for each game as listed in my original post
foreach($xbox360Games['Items'][0]['Images']as $val2) {
if ($val2['Purpose'] == "BoxArt" && $val2['Height'] == 300) {
$url = $val2['Url'];
$htmlxbox .= "<img src=\" $url \" title= Current Game Score:". $val['currentGamerscore'] . ">";
break;
}
}
}
}
I am currently trying go get the Array value if Purposes = Thumbnail.
To do this I have setup a for each loop and if statement:
foreach(Array as $key => $val) {
if ($val['Purpose'] == "Thumbnail") {
print_r($val[url]);
}
}
I have done some testing and I have seen this take over 9 seconds to return the url.
My question is their a better way to get $val?
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.