Find specific string from response in php [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am getting following response
{"success":true,"error":false,"code":"SJKUT3GR"}
I just want to print SJKUT3GR from above.
anyone knows how to do this?

$data = json_decode($response);
echo $data->code;

Related

Select text on a string after X symbol [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
i have this string
$string = "Social\Notify\Models\User";
How can i tell to php how select just the fourth segment of it? in this case just the word User?
Something like this will do?
$str='Social\Notify\Models\User';
echo explode('\\',$str)[3]; //"prints" User

How to parse a txt file from steam [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I parse this txt file or how could i turn it into xml(if it's possible)?
Help please.
Edit: Yes, that is not a json.

How to save a file from a url with php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I save "example.mp4" from $url="http://videos.com/example.mp4" as "56.mp4" using a variable $id=56 to /videos
mkdir('/videos');
file_put_contents("/videos/" . ((string) $id) . ".mp4", file_get_contents($url));
Documentation:
http://php.net/manual/en/function.file-get-contents.php
http://php.net/manual/en/function.file-put-contents.php

Failed to load resource error https://graph.facebook.com/667771081/picture?type=normal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to load profile picture from Facebook Graph but it throws an error.
Please help me to get rid of this error.
use mysqli_fetch_array($qbids) insted of mysql_fetch_array($qbids)

Matching string with preg_match [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have the following string formats: "$ 3.20" or "$ 10.34". I want to verify with preg_match if the string is exactly this type of a format.
Any suggestions are appreciated?
Try this pattern:
if (preg_match('/\$\s[\d]+\.[\d]{2}/', $text)){
//do something
}

Categories