I'm looking for the following functions. Can someone fill in the ?.
$string = "8.5 x 11";
echo $x = ?;
//prints out: "8.5"
echo $y = ?;
//prints out: "11"
Thanks
What function should I use?
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: What function should I use?
Depends... If the x and the spaces are constant I would use explode().
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
-
tonykasdorf
- Forum Newbie
- Posts: 6
- Joined: Wed Mar 31, 2010 7:13 am
Re: What function should I use?
Yes, the "space" "x" "space" are constants. the two numbers at the beginning and end of the string are always changing. The numbers will very in size from two to four numbers in length.
I'm looking for the code that can break the two numbers up and give them to me in two separate variables.
I'm looking for the code that can break the two numbers up and give them to me in two separate variables.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: What function should I use?
Right.. then explode()