0

I am developing an application were I need to use the next PHP5 code:

<?php

$Hurrengo_Hitza = 'word_3';

$Handiena_MarkID = 0;  
$Handiena_Hitzarentzat = -2;
$Hitza_Index = substr($Hurrengo_Hitza , 5);

    print $Handiena_MarkID . $Hitza_index . $Handiena_Hitzarentzat;

The result I am looking for is 0 3 -2 and the result I am getting is 0-2. Which is the problem?

1
  • try to use english variable name. Commented Apr 22, 2012 at 11:10

4 Answers 4

1

This is just a minor case of typo and case sensitivity.

print $Handiena_MarkID . $Hitza_index . $Handiena_Hitzarentzat;

Notice in that line it says $Hitza_index and not $Hitza_Index. Since variables in PHP are case-sensitive, you need to change that to $Hitza_Index.

Sign up to request clarification or add additional context in comments.

Comments

0

Variables in PHP are case-sensitive.

Comments

0

Try this:

$Hitza_Index = substr($Hurrengo_Hitza, -1);

1 Comment

And yes, agree with what exactly the others answer said. Variables in PHP are case-sensitive. So, pay attention to the line: print $Handiena_MarkID . $Hitza_Index . $Handiena_Hitzarentzat;
0

You have a lowercase i in $Hitza_index when printing, while it's uppercase when assigning.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.