Jump to content


Photo

T_String Error! Please Help


  • Please log in to reply
2 replies to this topic

#1 XtremeTeam

XtremeTeam
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 01 October 2006 - 11:23 PM

Can someone please tell me what is wrong with the code below? It gives me a T_String Error.
---------------
$randimnumr = rand(0,count($rarray1)-1);

print $rarray[$randimnum];
---------------

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 01 October 2006 - 11:30 PM

For starters, your variable is called $randimnumr and you refer to it as $randimnum (note the missing r off the end).

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 01 October 2006 - 11:44 PM

The (other) error is caused by lines before those you posted. Show us some code, say 8-10 lines ending with those two.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users