String Functions I


#1

Did you remember to print your substring? i did it but error occurs why?

<?php
$myname = "Nayan";
print "$myname";
?>

<?php
$partial= substr($myname, 0, 3);
print $partial;
?>

<?php
$uppercase=strtoupper($myname);
print "$uppercase";
?>

<?php
$lowercase=strtolower($myname);
print "$lowercase";

?>


#2

you have to print the value of the variable not the variable

remember string needs " " variable doesn't


#3

Is it okey now?
<?php
$myname = "Nayan";
$partial= substr($myname, 0, 3);
print $partial;
?>

<?php
$uppercase=strtoupper($myname);
print $uppercase;
?>

<?php
$lowercase=strtolower($myname);
print $lowercase;

?>


#4

done it, actually the problem is i change the format at first that's why the problem occurs anyway thanks for your feedback.


#5

Maybe, i didn't know what the lesson wants.
but it''ll surely cause an error if you put your variable inside " "

next time add the lesson url too.it'll be very helpful for those who wants to help you :slight_smile:

glad! you sloved :slight_smile:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.