-6

So I want to put a variable value in this link where "90" is and I'm not sure how to do it. Does anyone know how to do this? Sorry for the stupid question I'm relatively new to programming with PHP.

$url = "http://junna.com/mamba90nina"; 

Thanks!

3
  • 4
    "I'm relatively new to programming with PHP" --- if you are, why don't you start learning from very basics?
    – zerkms
    Apr 16, 2013 at 1:30
  • preg_replace is what you might be looking for. If your "new to PHP` then regex will be very complicated for you
    – Daryl Gill
    Apr 16, 2013 at 1:31
  • 1
    Isn't this pretty much like your previous question on outputting variables within some text?
    – mario
    Apr 16, 2013 at 1:45

1 Answer 1

0

You would do so by creating the variable ($value as I've done below) and then concatenating the $url string using .

$value = '90';
$url = "http://junna.com/mamba" . $value . "nina"; 
6
  • What I am trying to do is scrape this url but when I try it I get this error: Apr 16, 2013 at 1:55
  • cURL error number:6 cURL error:Couldn't resolve host Apr 16, 2013 at 1:56
  • @michaelrouse You say nothing about cURL or scraping in this post ... Apr 16, 2013 at 1:59
  • I know I said that because I was wondering if you knew how to fix this. Apr 16, 2013 at 2:00
  • For some reason it's really picky. Apr 16, 2013 at 2:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.