answersLogoWhite

0


Best Answer

You must start with double quotes to get expanded variables, then escape nested ones with backslash

<?php echo form_radio($data['filename'], 0, '', "class="uniform" id="$data[ids]"");

Or use single quotes inside double

<?php echo form_radio($data['filename'], 0, '', "class='uniform' id='$data[ids]'");

Notice you don't need to quote single dimensional array indexes inside the square braces if inside double quotes

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you mix PHP with a string inside CodeIgniter function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you Count node left and Right for binary tree using PHP Codeigniter?

First you will need a PHP codeigniter to configure the proper equation. Then follow the steps very carefully.


What does the php function eval?

The eval() function evaluates a string as PHP code. http://us.php.net/manual/en/function.eval.php


How do you reverse a string in PHP without using a function?

Without any function is impossible. So I'll assume you mean any coded function, in which case the predefined function below is your answer.$string = strrev($string);


How do you reverse a string in PHP?

A predefined function can reverse a string as shown below:echo strrev('pizza'); // outputs: azzip


How do you check the length of a string in PHP?

It is fairly simple to check the length of a string in PHP. All you need to do is use the function strlen(). Below is an example of how it is used. &lt;?php $my_text = "Hello"; echo strlen($my_text); // outputs 5 ?&gt;


How do you write string in reverse through the HTML tags?

Not possible through html. Use php strrev function. For eg:


How do you define a constant in PHP?

You can define a constant using the define() directive.you can use this a number of ways;to define a variable to a constant do:$string = "hello";define("string",$string);to define a string to a constant use:define("hello","there");to define a integer or other numerical value use:define("number",1.0);Summery:to define a string use quotes as you would do a string.Unlike variables in PHP a constant cannot be changed or undefined once it is defined. Constant remains automatically globally throughout the script. It means that it can be accessed from inside a function. e.g.


You use a Html button in Php on its onclick you made a function but its not responding?

this is not really a question... But I think you are asking why php functions inside a HTML button do not work. Well probably because php is rendered serverside and is passed to a user-browser afterwards.... it is possible to use php inside onclick... but only to display specific content (javascript function for instance)... it is not possible to let a user decide to run a specific php function by clicking a button.


How do you remove whitespaces from a string in PHP?

&lt;?php trim(ereg_replace( ' +', ' ', $extraWhiteSpace)); ?&gt;


What is var char in php?

Varchar in SQL means string in PHP.


Which function is used to retrive the part of the string?

If a string features a separator (e.g. a dot or a comma), use PHP's explode() function to get an array with the two parts: $string = "hello,joe" $array = explode(",", $string); $array[0] will be "hello" $array[1] will be "joe" If not, you may use substr() to return a certain length of a string


How to use strings with PHP and MySQL?

If you will see this example as below, this may help. &lt;?php $string = mysql_real_escape_string($string); $sql = "insert into stringtable(mystring) values('$string')"; ?&gt;