codepad

Warning: preg_match(): Internal pcre_fullinfo()

邮差的信 提交于 2019-12-17 19:33:18
问题 I have the following working code: $test = '123456'; $int = preg_match('/^\d+$/', $test, $matches); print_r(array($int, $matches)); However when I execute it on codepad I get the error: Warning: preg_match(): Internal pcre_fullinfo() error -3 on line 5 But the code is running on my own machine (and the code should be fine IMHO). I need to distribute my code in the future so it would be bad if it would break depending on some config. So what is the reason codepad breaks on it? 回答1: Code

Online C++ compiler with input stream? [closed]

ぃ、小莉子 提交于 2019-11-29 11:29:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I kinda like codepad online editor (supports C++), but I'd like to use some scanfs which is not possible with codepad. Is there some online C++ compiler that supports input streams? Is that even possible? 回答1: IDEOne supports passing in the input; you can specify it in a <textarea> . 回答2: [ Disclaimer: I prefer

PHP file_get_contents() not working

ε祈祈猫儿з 提交于 2019-11-29 07:45:57
Can anyone explain why the following code returns a warning: <?php echo file_get_contents("http://google.com"); ?> I get a Warning: Warning: file_get_contents(http://google.com): failed to open stream: No such file or directory on line 2 See codepad As an alternative, you can use cURL, like: $url = "http://www.google.com"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); echo $data; See: cURL Try this function in place of file_get_contents(): <?php function curl_get_contents($url) { $ch = curl_init();

PHP file_get_contents() not working

谁说我不能喝 提交于 2019-11-28 01:49:33
问题 Can anyone explain why the following code returns a warning: <?php echo file_get_contents("http://google.com"); ?> I get a Warning: Warning: file_get_contents(http://google.com): failed to open stream: No such file or directory on line 2 See codepad 回答1: As an alternative, you can use cURL, like: $url = "http://www.google.com"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); echo $data; See: cURL 回答2