[問題] 傳字串到php,再由php傳字串回來處理
環境:
Ruby 1.8.6
msg_to_php.rb
msg="我輸入一串字"
def run(cmd, input='')
IO.popen(cmd,'r+') do |io|
io.puts input
io.close_write
return io.read
end
end
puts run './read_from_ruby.php #{msg}'
結果跑出
./msg_to_php.rb:13: warning: parenthesize argument(s) for future version
請問有沒有其它的方法能做到字串傳到一寫好php程式,再把php傳回的字串繼續處理?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.17.173.206
→
10/16 09:53, , 1F
10/16 09:53, 1F
→
10/16 09:57, , 2F
10/16 09:57, 2F
→
10/16 10:17, , 3F
10/16 10:17, 3F
→
10/16 10:17, , 4F
10/16 10:17, 4F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章