On the basis of what you are trying to do:
<?php
$row = "www";
echo ''.base64_encode($row).'';
The direct equivalent with double quotes would be:
<?php
$row = "www";
echo "".base64_encode($row)."";
An empty string of single quotes, ''
, can also be represented with double quotes, ""
.
Even so the correct way (without unnecessarily concatenating empty strings) to do so would be:
<?php
$row = "www";
echo base64_encode($row);
This is because in your code with single quotes you are concatenating an empty string before and after the call to base64_encode()
, being completely unnecessary to do so since echo
can directly receive the output of base64_encode()
without need to do nothing more.
Regarding the attempt you have made:
<?php
$row = "www";
echo "base64_encode($row)";
It is not possible to execute a function (or method) inside the double quotes. In the PHP documentation you can see that you can only interpret values of variables or properties of class.