Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

php strings within strings

Posted on 2011-10-07
5
Medium Priority
?
172 Views
Last Modified: 2012-05-12
Hi Experts,

I have this script for example...

$type = "blog";
$blog_form = "title,date";
$title_element = "hello";
$date_element = "1st October";

$form = explode(",", $I NEED TYPE IN HERE_form);
for($i = 0; $i < count($form); $i++){
      echo $$form[$i]_element;

}


Output being:

Hello 1st October


Any ideas would be swell!!

0
Comment
Question by:maccaj51
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Insoftservice
ID: 36930086
what is $I NEED TYPE IN HERE_form just confused please elaborate little more
0
 

Author Comment

by:maccaj51
ID: 36930091
Sorry... I have found a solution...
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 36930098
good to hear tht
0
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 36930912
$title_element = "hello";
$date_element = "1st October";

$answer = ucfirst($title_element) . ' ' . $date_element;
0
 

Author Closing Comment

by:maccaj51
ID: 36939360
This is what I had done! cheers ray
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question